Category ".net-6.0"

Graph API to know when email is sent

I am currently sending emails via Graph API using the following code: var graphClient = GetAuthenticatedGraphClient(); var metadata = JsonSerializer.Deserialize

AutoMapper .NET6 C#10 Blazor WASM PWA

I had a problem that the AutoMapper worked in .NET5 with in Program.cs -> services.AddAutoMapper(typeof(Startup)); New Blazored WASM PWA do not have a Startu

How to get ILoggerFactory in .net 6

In .Net5 ILoggerFactory is used as Configure function in Startup.cs as follows : public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger

Convert a string to a class type/model in C#

It seems that the default Jason Taylor's clean architecture .net template doesn't allow custom order or filtering. Indeed, the default GetTodosQuery.cs only all

ASP.NET Core 6 how to access Configuration during startup

In earlier versions, we had Startup.cs class and we get configuration object as follows in the Startup file. public class Startup { private readonly IHostE

Web Application build error with net6.0 framework, is already signed (NETSDK1177)

I am working on MAC and dotnet core 3.1, 5.0 and 6.0 versions are installed on my machine. I not able to build Web Application on my machine due to shared error

Error adding migration when data models are in a separate assembly

I've just setup new projects, Pegasus (my main web application) and PegasusEntities (my database objects). My Pegasus start-up code includes the following. buil

Web API with Microsoft Identity Platform Authentication

I created a new ASP.NET Core Web API with Authentication type "Microsoft identity platform" based on the VS2022 template. On Azure I setup the following with my

.Net 6: Enable Windows and Anonymous authentication for one

I work on a .Net core application and I need to mix windows and anonymous authentication within the same endpoint(s). So the goal is to be able to determine the

ASP.NET Core 6 running in k8s shutting down

OK I´m new to ASP.NET Core 6 and k8s. So far all apps I was hosting (java, js, python) didn't have any issue. Deployment service and ingress were created

The type forwarder for type 'System.ComponentModel.INotifyPropertyChanging' in assembly 'System' causes a cycle

I am working on upgrading WPF application which is built using .Net Framework 4.6 to .Net 6. While upgrading a few assemblies, I encountered this strange issue

Can't use AddHttpClient / IHttpClientBuilder in console app

I have some code from a web app that configures the http client to use a certificate. I relies on IHttpClientBuilder and AddHttpClient. I'd like to use the same

Returning default mock results from actual objects' instances

Consider a scenario when you need to write integration tests for the REST API controllers. I use MSTest for this. The logic is following: Create new database, r

Returning default mock results from actual objects' instances

Consider a scenario when you need to write integration tests for the REST API controllers. I use MSTest for this. The logic is following: Create new database, r

CS8032 warning with Microsoft.CodeAnalysis out of no where

I've had a solution with a large number of projects in that has built fine since we switched to .NET6 then suddenly I am getting for every project this warning

Using WebApplicationFactory to do E2E testing with .Net 6 (minimal api)

Im trying to get E2E/UI testing (selenium, playwright) to work with my unit testing framework. The basic idea it to use MSTest and the WebApplicationFactory to

How to get Priority of C# PriorityQueue element

I am initializing a priority queue that stores XY coordinates, prioritized by their euclidian distance from origin. I created a custom Comparer that makes this

Use Web Compiler for SCSS files in Azure DevOps pipeline

Is it possible to use Web Compiler (developed by Mads Kristensen) in a CI pipeline in Azure DevOps? We have the Web Compiler Visual Studio tool installed on our

Unable to connect and get Sharepoint data from C# .Net Core App

While using pnp.Framework in .Net 6 environment. I need authenticated client context to get Sharepoint Data but facing 403forbidden while running context.Execut

Are there benefits in producing a .NET 6.0 version of a .NET Standard 2.0 library?

If I have a .NET Standard 2.0 library project that is being consumed by a .NET 6.0 console project, are there any performance benefits if I also instruct the co