Category ".net-core"

Concurrency: Detecting async-unsafe code (e.g. by detecting a forked ExecutionContext)

I have a multi-threaded codebase that manipulates a stateful object that cannot be safely used concurrently. However, it's hard to prevent concurrent usage, and

The key was not found in the key ring

I have a netcoreapp3.1 application deployed to on-prem IIS instances using the .NET Core Hosting Bundle. Because the app is deployed to 2 load balanced servers

Trying to debug my dotnet 5 WPF app and getting an error: "The target process exited without raising a CoreCLR started event."

This is dotnet 5 WPF app that was converted from a dotnet framework app using this tool from Microsoft. The full error says The target process exited without r

OpenIdDict - WebApi endpoint protection

I am trying to implement WebApi protected by access_token issued by an OpenIdDict auth server. Some APIs don't require authentication, while others do. The form

Error when replacing .ToList() calls in with an IQueryable

I'm trying to improve the efficiency of this method and I can't figure out why my "solution" is throwing an error. Here's the existing and working, albeit slow,

GitLab pipeline with dotnet and node image

I'm creating a GitLab pipeline which should build, test and deploy a dotnet core application with Angular application. So far so good! This project was created

Why do I get "The response ended prematurely" when using the HttpClient in C#?

My first code of HTTP Client in .Net Core. The server is running on my PC as well, so I want to send it to localhost. I've added printing of the inner exception

Azure durable function on aks cluster not working

I have created an azure durable function and put it in a docker container, everything is working in docker desktop, the azure durable function is using and MQ r

JsonElement and null conditional operator (KeyNotFoundException)

I have a JSON object that I get from API and I need to check for error in the response of the JSON. However, when there is no error the error value is not prese

SELECT result map to entity in Dynamic Linq in Entity Framework Core

I have a Linq query which is selecting 2 columns(that can be any 2 from all columns) dynamically based on some condition.I need to map the query result in to be

How to Sort a Model Based on a Property in IList<T> within that Model

This is a bit more complex than other questions. I have a Model that encapsulates an IList. Within each IList item there are multiple Lists. This makes it VERY

Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: The same schemaId is already used for type "X"

The project of .net core WebApi generate the right swagger when a class is generated in one DLL. this solution works fine, the project is compiled and the swagg

Can I pre-authenticate my Angular Client Application using Identity Server 4 to call my locally hosted .Net Core WebAPI

I have an Angular Client App, which calls a .Net Core WebAPI hosted on the same box. It is authenticated using Identity Server 4 in a separate WebAPI.OAuth app

The instance of the entity type cannot be tracked because another instance with the keyvalue is being tracked

I am basically trying to implement CRUD using EntityFrameWork core and .Net core 3.1. I have an issue with my update operation where I am not able update the co

"System.ComponentModel.Win32Exception (0x80090308): The token supplied to the function is invalid" when TLS13 is enabled

After adding the below registry key to enable TLS1.3 on Windows Server 2022 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Proto

Windows or Visual Studio can't find the latest installed .NET SDK due to bitness

I've successfully installed the latest .NET SDK, but Windows doesn't recognize it. This is manifested by one of the following failures: dotnet --list-sdks does

Inject service to configure SignalR backplane

I am trying to use Azure Redis instance as the backplane for my dotnet core signalr application. I need to pull the configuration settings from a database. How

How can i remotely debug an asp.net core web app deployed on an azure app service

I am working on an asp.net core web application. I need to debug this application (put a breakpoint and inspect variables when this breakpoint is hit). I can do

Error while validating the service descriptor 'ServiceType'

I interject in the method but it showing exception here: The code is extension of the services. public static IServiceCollection AddServices(this IServiceCollec

grpc and polly - .net core 6

I'm trying to use Polly as retry policy handler for grpc in my .net core 6 project. I noticed that the retryFunc is never invoked. I started from this project g