Category ".net-core"

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

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

Subscriptions are not creating in the report server database

I have written the code to create the subscriptions by adding the reference to ReportService2010.asmx. Please see the below screenshot for code and result [Id =

.net core linq select overload index does not work

I got a linq lambda select code that works before I added the Select index overload. Before, I got the list of records but I need the index which I use to assig

Optimistic Concurrency Exception

I have been battling with this error for a while now. I hope putting it here will help. I have attached by models and also the method call being made. The erro

C# - WCV using class from .net core project

I have some problem with my project, i'm making application in .net core but i also need to create api, i want to make "wcf service" and now i can't use class f

Set service startup options for .net core worker service

I am trying to create a Windows service by writing a .NET 5 worker service, and I am hung on where in my code I would set up the service as auto-start, auto-sta

Is there a way to list down only the custom dotnet templates installed?

dotnet new --list lists all the built-in and custom templates installed. But I want to list only the custom templates that I have created and installed. Is ther