Category ".net-core"

Minimal API Registering Dependencies

I am trying to register dependencies but one thing that is strange is when using specific handlers. For example, take a simple scenario like: using Microsoft.As

What is the difference between homebrew casks 'dotnet' and 'dotnet-sdk' and formula 'dotnet'

Running brew search dotnet shows the following ❯ brew search dotnet ==> Formulae dotnet

Mapster context is null in nested mappings

How I can use MapContext.Current in nested mappings? For example: public class Foo { public string Name { get; set; } } public class Bar { public strin

Why does Event Grid serialize my already serialized data?

I am trying to get into dotnet and Azure and so I build small solution that triggers a azure function by http with a count that then requests the given amount o

dotnet watch run -c $(Configuration) with hot reload

I want to launch my Blazor app with specific configuration and have hot-reload enabled. When I launch with: dotnet watch Hot reload is enabled and everything i

EF6 Entity framework sometimes slow query on SQL Server

We have started a new project in .NET Core. We are just starting out and we are hitting a Web API endpoint to get some reference data of 8 records. We noticed

Powershell running .NET Core on Linux RedHat giving SSL error connecting

I am currently trying to use dotnetcore to run a script over Powershell. This script uses a library that will authenticate with Azure using a service principal

Deserialize json properties when property name matches only partially JsonPropertyNameAttribute.Name value

I am looking for a mechanism in the System.Text.Json package, where I would be able to deserialize JSON on partially matching property names. Unfortunately, the

Where to place the resource root id in the url?

I have resources linked like this: A->B->C->D I want to design a REST API to retrieve the D elements inside of A Which is the best design approach? api

Handled exception causes an AccessViolationException

I would like to ask for help with a C# API Project, to be more specific, an exception that have been giving issues for some pretty long time now. Currently the

WinForms Form is never garbage collected due to reference from ServiceScope

I have a WinForms Form(s) that is not always garbage collected. The form loads quite a bit of data and when it is not garbage collected, it can cause a signific

Convert Word doc and docx format to PDF in .NET Core without Microsoft.Office.Interop

I need to display Word .doc and .docx files in a browser. There's no real client-side way to do this and these documents can't be shared with Google docs or Mic

How to generate empty migration in EF Core code-first while ignoring pending changes?

I am aware that the add-migration command will generate a new migration file with empty Up() and Down() methods. However, I have an error when building which me

Assert anonymous object equivalence

I'm sure i'm missing the obvious... Say we have: [Fact] public void SomeTest() { var a = new { SomeProp = "hello", AnotherProp = 9 }; var b = new { Some

Hot to debug playwright-dotnet tests with Microsoft.AspNetCore.TestHost

I'm trying to run Playwright locally by using debugging from xUnit and AspNetCore.TestHost and even if when I call the API endpoints the calls are successfully

How do I make a .NET Core 6 Top-Level statement template async?

I'm follwoing this guide: https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration and I don't understand how to make my application work as an asy

Accessing the parameters injected in ConfigureServices from custom Middleware

I am practicing to learn more about the Dependency Injection and the Middleware in ASP.NET Core and I have faced an issue I can not resolve, so need the assista

ASP.NET Core 5.0 MVC : CS1061 error using Html.RenderAction

I am working on a project using ASP.NET Core 5.0 to build a web app (MVC). I tried to use the Html.RenderAction extension method but I get the following error.

How to install specified framework in Teamcity server as a build step

I have dotnet project built using dotnetcore v2.0 which was working fine in Teamcity pipeline. I have updated the project to use dotnetcore v3.0 and re-run the

Relationships in Entity Framework with users from AzureAD

I'm relatively new to Microsoft solutions and I need your guidance. I'm quite certain the answer exist somewhere, but I lack key words for my searches. My stack