Category ".net-6.0"

EF Core - Unable to resolve service for type DbContext while attempting to activate ApplicationContext

I am attempting to scaffold CRUD razor pages using entity framework but the code generator throws the following error: There was an error running the selected

NET6 Linux-x64 Self-Contained Single-File Unusable

I've a project that runs perfectly as "Framework-Dependent Single-File" on Linux-x64, and also as a "Self-Contained" application. But when I compile as "Self-Co

Identity Server 4 connect/token works when self hosted but not when deployed

I built an .NET Core 3.1 IdentityServer4 to protect some API endpoints: public static class Config { public static IConfiguration Configuration { get; }

Get the raw request that is sent with HttpClient and HttpRequestMessage

In my C# code running .NET 6 (Azure Function) I am sending an HttpRequestMessage using HttpClient. It doesn't work but it should work, so I want to get the raw

Razor Pages Cannot Read File with build action "Content" Properties

I have a resources file name "Index.en-US.resx", initially it was "embedded resources" build action and it worked well in localization. But when it is "embedded

Oracle sequence EF Core 6.0?

I need to get a NEXTVAL from a SEQUENCE in an Oracle database. The modelbuilder does have a builder.HasSequence("TABLE_SEQ"); But I have no clue on how to use

Link the selected item of drop down list to sql script with an on change event

I have been battling this for some time now without success. So Your help is extremely appreciated. I have created a dropdown list from sql database. What I wan

How to correctly update database when users session expires for ASP.NET web application using the new .NET 6 format?

When a users session expires I want to update the database to switch their status to offline but I cannot find the right way to do this as I know that they can

Comparing two objects with == operator

I have this code that checks the references of two variables, I came across this case which is a bit confusing : string first = "10"; object second = 10.ToStrin

Ocelot Aggregator doesn't work for post method

Good afternoon community. I present my case and then I ask the question. In ocelot.json I have the corresponding configuration to consume the microservice meth

Why is JobConsumer not being hit/run?

I am trying out the new MassTransit IJobConsumer implementation, and although I've tried to follow the documentation, the JobConsumer I have written is never be

.NET 6: How to use method overloading in console app Startup?

.NET 6 offers boilerplate-removal in console applications Startup class. I try to run this simple test code: Console.WriteLine("Hello, World!"); static void Te

AddScheme options not loading from appsettings

I have this line in program.cs builder.Services.AddAuthentication() .AddScheme<SharedSecretAuthenticationOptions, SharedSecretAuthenticationHandler>(S

TrayIcon with WinUI 3

I am trying to make a program that runs in the background, and I want to place a Tray Icon in the Tray Icon Section of Windows. I didn't find a solution to do t

asp.net 6 EF using MySql Database not working

I am trying to connect my Web API build in asp.net 6 with MySql and I am having a lot of trouble My Service looks like this builder.Services.AddDbContext<Tic

HttpClient timeout on Braintree call in Blazor

I'm deploying my .Net 6, Blazor Server site for the first time on shared hosting. It's all seems to work so far bar two things. In the browser console (Chrome)

WorkerConfig for runtime: dotnet-isolated not found

Created a .NET 6.0 Isolated Function (with HTTP Trigger) in Visual Studio 2022. But when running/debug this function locally, get following error: Microsoft.Azu

How to manage nuget packages globally for all projects in a solution using Visual Studio 2022?

I have a solution created in .NET 6.0 using Visual Studio 2022 which has many projects. Each project has so many nuget package references in the .csproj file as

TypeLoadException Method 'IsValid' in type in Pomelo.EntityFrameworkCore.MySql.Update does not have an implementation

When I use Pomelo.EntityFrameworkCore.MySql in combination with Microsoft.AspNetCore.Identity I am getting that error. Are my dependencies wrong ? Similar issue

How to start my Worker Service on the hour

I have this worker service kicking off jobs but hourly it checks for jobs. How can I get it to check on the hour rather at the run time hourly? public class Wor