tagged [.net-core-3.0]

Is there a robust way to register dependencies in ASP.NET Core 3.1 beside adding everything into Startup class?

Is there a robust way to register dependencies in ASP.NET Core 3.1 beside adding everything into Startup class? I have an ASP.NET Core 3.1 project. Typically, I register any dependency using the `Conf...

How to change the default port in asp.net Core 3 or Net Core 5

How to change the default port in asp.net Core 3 or Net Core 5 when I am in debug, to change the default port, I modify the launchSettings.json file, and change the port ``` "WebApplication1": { "c...

'ConfigureServices returning a System.IServiceProvider isn't supported.'

'ConfigureServices returning a System.IServiceProvider isn't supported.' I need ti use this `AutoFac` in ASP core 3.0 When I use this code in startu up: It show me this error: > 'ConfigureServices ret...

How to use class fields with System.Text.Json.JsonSerializer?

How to use class fields with System.Text.Json.JsonSerializer? I recently upgraded a solution to be all .NET Core 3 and I have a class that requires the class variables to be fields. This is a problem ...

Asp.Net Core 3.0 CreatedAtAction returns "no route matches the supplied values" when Action name ends with "Async"

Asp.Net Core 3.0 CreatedAtAction returns "no route matches the supplied values" when Action name ends with "Async" I had a strange problem with CreatedAtAction, if my method name ends with "Async" key...

.NET Core 3.0: Razor views don't automatically recompile on change

.NET Core 3.0: Razor views don't automatically recompile on change According to [the documentation](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0), Razor...

Can you use IAsyncEnumerable in Razor pages to progressively display markup?

Can you use IAsyncEnumerable in Razor pages to progressively display markup? I've been playing around with Blazor and the IAsyncEnumerable feature in C# 8.0. Is it possible to use IAsyncEnumerable and...

Using System.Windows.Forms classes in a .net core 3.0 preview9 project

Using System.Windows.Forms classes in a .net core 3.0 preview9 project How can we use classes like [Screen](https://learn.microsoft.com/de-de/dotnet/api/system.windows.forms.screen?view=netcore-3.0) i...

25 Sep at 14:42

Accessing the SerialPort class using .Net Core 3.0

Accessing the SerialPort class using .Net Core 3.0 I'm starting a new .NET Core 3.0 project in which I need to access the System.IO.Ports.SerialPort class. The documentation I'm reading on the class s...

Is there a System.Text.Json's substitute for Json.NET's JsonProperty(Order)?

Is there a System.Text.Json's substitute for Json.NET's JsonProperty(Order)? Since `System.Text.Json` is now JSON lib for [.NET Core 3.0](https://learn.microsoft.com/en-us/dotnet/api/system.text.json?...

How to run multiple BackgroundService parallel in .net core 3.0?

How to run multiple BackgroundService parallel in .net core 3.0? How is it possible to run multiple IHostedServices in parallel? I use the WorkerService in .Net Core 3.0 and want both services to run ...

14 Oct at 09:23

The JSON value could not be converted to System.Nullable[System.Int32]

The JSON value could not be converted to System.Nullable[System.Int32] I updated an ASP.NET Core 2.2 API to ASP.NET Core 3.0 and I am using System.Json: I then tried to post JSON data using Angular 8,...

Relationship between C# 8.0, NET Core 3.0 and Visual Studio

Relationship between C# 8.0, NET Core 3.0 and Visual Studio The article [Building C# 8.0](https://blogs.msdn.microsoft.com/dotnet/2018/11/12/building-c-8-0/) states > The current plan is that C# 8.0 w...

14 Jul at 03:15

System.Text.Json.JsonElement ToObject workaround

System.Text.Json.JsonElement ToObject workaround I want to know the equivalent of the `ToObject()` method in [Json.NET](https://www.newtonsoft.com/json/help/html/Introduction.htm) for . Using Json.NET...

10 Aug at 14:32

How to add property in existing json using System.Text.Json library?

How to add property in existing json using System.Text.Json library? ``` { "TestData":{ "Year__of__Account":"2019", "Tax___x0025_":"0.06", "Buildings__1":"1000", "Cont...

add all the required services by calling 'IServiceCollection.AddHealthChecks'

add all the required services by calling 'IServiceCollection.AddHealthChecks' I am using ASP.NET Core 3, .NET Core 3.0.100, Visual Studio 2019 Community. I follow this guide [https://learn.microsoft.c...

System.InvalidCastException: 'The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects.'

System.InvalidCastException: 'The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects.' I migrated my project from ASP.NET Core 2.2 to ASP.NET Core 3.0. No...

Cannot add appsettings.json inside WPF project .net core 3.0

Cannot add appsettings.json inside WPF project .net core 3.0 I am creating a WPF project using .net Core 3.0, and I am having trouble adding the item `appsettings.json` file to my project which is to ...

5 Apr at 11:22

Use Visual Studio 2017 with .Net Core SDK 3.0

Use Visual Studio 2017 with .Net Core SDK 3.0 How Can I open `.Net Core 3.0` project in Visual Studio 2017? I have downloaded the .NET Core 3.0 SDK from [dotnet.microsoft.com](https://dotnet.microsoft...

Converting newtonsoft code to System.Text.Json in .net core 3. what's equivalent of JObject.Parse and JsonProperty

Converting newtonsoft code to System.Text.Json in .net core 3. what's equivalent of JObject.Parse and JsonProperty I am converting my newtonsoft implementation to new JSON library in .net core 3.0. I ...

What is the difference between Host and WebHost class in asp.net core

What is the difference between Host and WebHost class in asp.net core I was trying to migrate the my application from asp.net core 2.1 to 3.0 and there come a first suggested change in program.cs for ...

.NET Core 3.0 migration error IAsyncEnumerable<T> exists in both System.Interactive.Async and System.Runtime

.NET Core 3.0 migration error IAsyncEnumerable exists in both System.Interactive.Async and System.Runtime I am trying to migrate a project from .net core 2.2 to 3.0. I am getting the error: > Error CS...

29 Oct at 08:26

How to define an endpoint route to multiple areas

How to define an endpoint route to multiple areas I am trying to define a `MapAreaControllerRoute()` that routes to multiple Areas. In ASP.NET Core 3.0, however, there is the `areaName:` parameter tha...

How to replace AddJwtBearer extension in .NET Core 3.0

How to replace AddJwtBearer extension in .NET Core 3.0 I have the following code which compiles and works in .NET Core 2.2: ``` byte[] key = Encoding.ASCII.GetBytes(Constants.JWT_SECRET); services...

How to resolve HostedService in Controller

How to resolve HostedService in Controller I am trying to add a Background Timer in ASP.NET Core 3.0, which periodically executes a task. Google led me to [this](https://learn.microsoft.com/en-us/aspn...

15 Oct at 15:10