Answer by Simon_Weaver for Disable re-queueing of failed Hangfire BackgroundJob
Important if using DI container with an interface, you must put the attribute on the interface definition or it won't be recognized.public interface IDataUpdater{ [Hangfire.AutomaticRetry(Attempts = 0,...
View ArticleAnswer by Simon_Weaver for Losing Session State with ASP.NET/SQL Server
Another thing that can trip up session state is having the wrong domain set for httpCookies, so make sure you have the correct domain / subdomain.<system.web><httpCookies domain=".example.com"...
View ArticleAnswer by Simon_Weaver for How to display messages as list in gmail api?
For a newly created OAuth token - try waiting!I had a weird experience just now.I modified the example that shows labels to search messages but was getting an error:var messages = await...
View ArticleAnswer by Simon_Weaver for Set null as empty string value for input field
Note: This does work for number fields with a caveatCurrently the NumberValueAccessor (source) sets the value to null when the field is empty.However, be cautious of this issue...
View ArticleAnswer by Simon_Weaver for Can I hide the HTML5 number input’s spin box?
Important message of cautionWhen using a mouse with a scrollwheel, be aware that scrolling with the cursor hovering over a type=number textbox results in the number changing up or down.Now this may be...
View ArticleAnswer by Simon_Weaver for How to check if ios safari/chrome is in lockdown...
I'm using this:if (typeof window.FileReader === 'undefined'){ alert('Do you have Lockdown Mode enabled on your device?\n\nIf so you will need to add our website to the list of allowed sites to...
View ArticleAnswer by Simon_Weaver for Can't find variable: FileReader in Safari
This error can occur when using Lockdown mode - as FileReader is not available.
View ArticleAnswer by Simon_Weaver for Please run `npm cache clean`
A 'non corrupted global cache' is not the same as a 'non broken node_modules' for a particular project.Just got this when trying to run a simple Angular CLI command (Windows):An unhandled exception...
View ArticleHow to set context on an Angular [cdkPortalOutlet]
The Portal module in Angular Material (CDK) is a very powerful way to render dynamic content into a 'PortalOutlet'.A Portal<T> can be a TemplateRef where T is the type of the context...
View ArticleAnswer by Simon_Weaver for ERROR Error: No value accessor for form control...
Check for basic typos in the control you're using.I'm using signals, where item.selected is a Signal<boolean> and was getting the same error on the following code:<mat-checkout...
View ArticleRun two async tasks in parallel and collect results in .NET 4.5
I've been trying for a while to get something I thought would be simple working with .NET 4.5I want to fire off two long running tasks at same time and collect the results in in the best C# 4.5 (RTM)...
View ArticleAnswer by Simon_Weaver for In Azure-devops, trying to create a drive using...
You can add -Scope Global to the parameters and it will then show in Windows Explorer or command line.
View ArticleAnswer by Simon_Weaver for TypeScript Type 'string' is not assignable to type
TypeScript 3.4 introduced the new 'const' assertionYou can now prevent literal types (e.g., 'orange' or 'red') being 'widened' to type string with a so-called const assertion.You will be able to do:let...
View ArticleAnswer by Simon_Weaver for TypeScript Type 'string' is not assignable to type
There are several situations that will give you this particular error. In the case of the OP, there was a value defined explicitly as a string. So I have to assume that maybe this came from a dropdown,...
View ArticleLooking for sample global.asax.cs files for routing information
No matter what you read about ASP.NET routing or REST I think the best way to learn more about them is to read other people's routing files. In a video with Jeff once you could catch a glimpse of the...
View ArticleAnswer by Simon_Weaver for Angular update from 8 to 13 peer dependency problem
This problem can get very frustrating. I've spent a couple of hours trying to understand it and even created dummy angular 13 / 14 projects to see what the latest defaults are.My tip is don't forget...
View ArticleAnswer by Simon_Weaver for Mandrill inbound: Reply mail not adding Metadata...
If you're using the .NET client you must use the AddMetadata method as opposed to just manually adding to the dictionary. How annoying - especially since the same doesn't seem true for Tags!//...
View ArticleAnswer by Simon_Weaver for Configure launchSettings.json for SSL in debug -...
You can also set the path to the pfx file in launchSettings like this.These are 'well known' environmental variable names.This is all you need to do.{"profiles": {"MyApp": {"commandName":...
View ArticleAnswer by Simon_Weaver for Does Dbcontext registered as "scoped" or...
If you've ever considering using Blazor, you need to consider scope even more carefully.Briefly, in Blazor you may find your DbContext is longer living 'by accident' because components are long living...
View ArticleAnswer by Simon_Weaver for Blazor onclick event is not triggered
Does your project include ASP.NET Core MVC?Warning: Do not put Blazor .razor components in /ViewsSo the component I was having issues with was originally a .cshtml page under...
View ArticleAnswer by Simon_Weaver for Where does MyApp.styles.css come from?
It’s CSS Isolation and the .css file is the result of bundling.https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-9.0
View ArticleComment by Simon_Weaver on How does Blazor know when to look for a parameter...
Important Note: A event handler in a component is also subject to this diffing - after all it is just another [Parameter]. Logically, it makes sense to think of int and string as 'input' parameters and...
View ArticleComment by Simon_Weaver on Why does Chrome devtools complain that I should...
For what possible reason apart from 'tricking' Chrome? (Unless of course you have a nested grid in that cell).
View ArticleComment by Simon_Weaver on Why does Chrome devtools complain that I should...
Still happens today! Apparently it was fixed a month ago, but not in the current version of Chrome (138).
View ArticleComment by Simon_Weaver on How to define templated component in...
I'd strongly recommend anyone trying to do something like this to check out the source for MudBlazorGrid (or your grid of choice). Look at how Columns is implemented (child columns initialize...
View ArticleAnswer by Simon_Weaver for Blazor: Conditionally display RenderFragment...
You can pass a RenderFragment to a component in two ways:Using the syntax you've already described<Card Title="Some title"><CardBody>My body content</CardBody><CardFooter><a...
View ArticleComment by Simon_Weaver on Cascade @typeparam in Blazor
@ddjerqq It's really not helpful or necessary to make a comment like that. The answer is absolutely not 'obsolete'. The only thing that is outdated is the context, and anybody today using version 8 or...
View ArticleComment by Simon_Weaver on Blazor and ContinueWith on page load
Microsoft still uses ContinueWith in some of their docs even today. Quite confusing tbh.
View ArticleAnswer by Simon_Weaver for tsconfig.json shows error: Entry point for...
Remember that @types is for npm projects that weren't originally written in Typescript.So if the library is migrated to Typescript you can uninstall the types.I just had the same issue with marked in...
View ArticleComment by Simon_Weaver on Azcopy error "This request is not authorized to...
Everybody spent way too much time on this!
View ArticleAnswer by Simon_Weaver for JobStorage.Current property value has not been...
Having issues with errors like this with RecurringJob?'Current JobStorage instance has not been initialized yet. You must set it before using Hangfire Client or Server API. For .NET Core applications...
View ArticleComment by Simon_Weaver on Unable to Hot Reload on Visual Studio 2022
What, why, how, huh?
View ArticleComment by Simon_Weaver on Unable to Hot Reload on Visual Studio 2022
Cannot stress this one enough! If your configuration is not called exactly Debug then it will not recognize changes, even if you refresh and even if the console says it 'Hot Reloaded'. The little check...
View ArticleComment by Simon_Weaver on Unable to Hot Reload on Visual Studio 2022
And it must be exactlyDebug, not a secondary debug-like config. Trust me on this one.
View ArticleComment by Simon_Weaver on DbFunctions.TruncateTime LINQ equivalent in EF CORE
If you don't assign it gets converted to a dynamic getdate() function call in SQL. If you assign to a local variable then that date value is fixed. I like to do the now = DateTime.Now thing because a...
View ArticleComment by Simon_Weaver on Using a 'using alias = class' with generic types?
Sad :-) I wanted to do using GroupingExpression<TSource, TGroupingKey> = Expression<Func<TSource, TGroupingKey>>;
View ArticleAnswer by Simon_Weaver for DbFunctions.TruncateTime LINQ equivalent in EF CORE
I still don't know why truncation isn't supported, but one way is using DateFromPartsOrderMonth = EF.Functions.DateFromParts(o.OrderDt.Year, o.OrderDt.Month, 1)Which gets translated pretty efficiently...
View ArticleComment by Simon_Weaver on Stop chrome back/forward two finger swipe
Anyone else get irrationally furious when this happens?
View ArticleAnswer by Simon_Weaver for DbFunctions.TruncateTime LINQ equivalent in EF CORE
The DateOnly type (since .NET 6) can be quite useful here:group events by DateOnly.FromDateTime(events.DateTimeFrom)I find it generaly much nicer to get a truncated date back as the DateOnly type,...
View ArticleAnswer by Simon_Weaver for Stop chrome back/forward two finger swipe
Chrome Settings > 'Swipe Between Pages'It's been promoted from a flag to a full feature, and apparently didn't respect my original choice 😡.Just go to Settings and search for gesture.
View ArticleAngular / Ivy error : Error: Token InjectionToken XXXXXXXXX is missing a...
Getting the error after updating to Angular 9 / Ivy compilerERROR Error: Token InjectionToken XXXXXXXXX is missing a ɵprov definition. at injectableDefOrInjectorDefFactory (vendor.js:47105) at...
View ArticleAnswer by Simon_Weaver for Apexcharts: Align xTicks and labels with beginning...
I tried way too long to get this to work with any combination of different options already suggested. I even managed to get it working such that redrawing the graph put them where I wanted, but then...
View ArticleAnswer by Simon_Weaver for How can I get all errors from ASP.NET MVC modelState?
During debugging I find it useful to put a table at the bottom of each of my pages to show all ModelState errors.<table class="model-state"> @foreach (var item in ViewContext.ViewData.ModelState)...
View Article