Questions tagged [.net-5]

The previous version of .NET, successor of both .NET Core and .NET Framework. Use this tag for questions about .NET 5 and .NET 5's formal specification.

For the original announcement of .NET 5, and for more detailed information, please refer to the official communication from Microsoft.

What

is the next big release to the .NET family after .NET Core 3.0. There is now just one .NET going forward, which is usable across many platforms. These platforms currently include Windows, Linux, macOS, iOS, Android, tvOS, watchOS, and WebAssembly, with more to be announced.

When

was released November 10, 2020. The first preview was made available on March 16, 2020. It will be supported with future updates to Visual Studio 2019, Visual Studio for Mac, and Visual Studio Code.

Why

.NET 5 is the next step forward with .NET Core. The project aims to improve .NET in a few key ways:

  • Produce a single .NET runtime and framework that can be used everywhere and that has uniform runtime behaviors and developer experiences.
  • Expand the capabilities of .NET by taking the best of .NET Core, .NET Framework, Xamarin, and Mono.
  • Establish a single code-base that developers (Microsoft and the community) can work on and expand together and that improves all scenarios.
  • Version 4 was skipped because it would confuse users that are familiar with the .NET Framework, which has been using the 4.x series for a long time.
  • 'Core' was dropped to emphasize that this is the main implementation of .NET moving forward

This new project and direction are a game-changer for .NET. With .NET 5, your code and project files will look and feel the same no matter which type of app you’re building. You’ll have access to the same runtime, API, and language capabilities with each app. This includes new performance improvements that are being committed to CoreFX regularly.

Everything you love about .NET Core will continue to exist:

  • Open source and community-oriented on GitHub.
  • Cross-platform implementation.
  • Support for leveraging platform-specific capabilities, such as Windows Forms, WPF on Windows, and the native bindings to each native platform from Xamarin.
  • High performance.
  • Side-by-side installation.
  • Small project files (SDK-style).
  • Capable command-line interface (CLI).
  • Visual Studio, Visual Studio for Mac, and Visual Studio Code integration.

Here’s what is new:

  • Developers will have more choice of runtime experiences.
  • Java interoperability will be available on all platforms.
  • Objective-C and Swift interoperability will be supported on multiple operating systems.
  • CoreFX will be extended to support static compilation of .NET (ahead-of-time; AOT), smaller footprints, and support for more operating systems.
  • .NET 5 shipped in November 2020, with the intention to then ship a major version of .NET once a year, every November.
  • This is a non LTS version, hence not recommended for production. .dotnet community planned to release every LTS version as a even versions, .i.e., .net6, .net8...

Announcements

3059 questions
21
votes
6 answers

Is there a high performance way to replace the BinaryFormatter in .NET5?

Before .NET5 we serialize/deserialize the Bytes/Object by these code: private static byte[] StructToBytes(T t) { using (var ms = new MemoryStream()) { var bf = new BinaryFormatter(); …
Fair
  • 431
  • 1
  • 5
  • 11
20
votes
1 answer

Deploy an ASP.NET Core app targeting a new version of .NET to an existing Azure App Service?

I have an existing Azure App Service running on ASP.NET Core 3.x. I have upgraded the application to today’s release of ASP.NET Core 5. This works fine on my local IIS Express server. When I publish to the application to the App Service using Visual…
19
votes
3 answers

need help migrating winform to net 5

I'm porting a winform app from net core 3.1 to net 5 and getting the following error. Severity Code Description Project File Line Suppression State Error NETSDK1136 The target platform must be set to Windows (usually by including…
M Leipper
  • 277
  • 5
  • 20
18
votes
1 answer

An assembly specified in the application dependencies manifest (Test.deps.json) has already been found but with a different file extension:

I am trying to publish a new .net API to IIS. because this needs to be done to a production server I am trying this with a sample API project and a test server to figure out how to go about this first. I used this as a reference. The project uses…
18
votes
2 answers

Failing to perform Cookie Authentication: SignInAsync and AuthenticateAsync not successful

I am trying to build a very simple playground server for me to study some ASP.NET Core authentication/authorization concepts. Basically a web app with a single, very simple controller, to be tested with Postman. I came up with a minified version of…
vinicius.ras
  • 1,516
  • 3
  • 14
  • 28
18
votes
2 answers

ODP.Net Driver Throwing Exception on .NET Core 5.0

I am trying to port my database application from .NET Core 3.1 to .NET Core 5.0. When running the following code, public async Task> LoadDataFromSQL(string sql, U parameters, string connectionStringName) { …
Jason D
  • 1,863
  • 2
  • 16
  • 30
17
votes
12 answers

System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String' with .NET 5

I've been implementing IdentityServer4 to provide authorization for my React application. I have this working in my local dev environment, but am running into issues after deployed to IIS in Windows Server 2016. I am able to generate an access token…
Rayan
  • 181
  • 1
  • 1
  • 4
17
votes
1 answer

Need understanding as to why string.StartsWith() is true when it should be false

So I have this file that I download via ftp. The file is just a config file for a system at my company I work for. Once the file is downloaded I open the file and processor the file. Part of the processing of the file is to check to see if a line…
Gaz83
  • 2,293
  • 4
  • 32
  • 57
17
votes
3 answers

.NET 5 - The framework 'Microsoft.NETCore.App', version '3.1.0' was not found

When using azure pipelines to build my .NET 5 function I am getting the following error ##[error]/home/vsts/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): Error : It was not possible to find…
Kevin Brydon
  • 12,524
  • 8
  • 46
  • 76
17
votes
5 answers

Package Microsoft.EntityFrameworkCore.Sqlite 5.0.0-rc.1.20451.13 is not compatible with net50 (.NETFramework,Version=v5.0) / win7-x86

I want to update my packages but I got some errors like this: The error is: Error NU1202 Package Microsoft.EntityFrameworkCore.Sqlite 5.0.0-rc.1.20451.13 is not compatible with net50 (.NETFramework,Version=v5.0) / win7-x86. …
x19
  • 8,277
  • 15
  • 68
  • 126
16
votes
3 answers

Could not load file or assembly Newtonsoft.Json when running app from the dotnet publish output folder

I am finding a problem with Newtonsoft.Json library throwing a System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file…
diegosasw
  • 13,734
  • 16
  • 95
  • 159
16
votes
2 answers

Why does an interface's default implementation get called when two classes are in the inheritance chain, and the class in the middle is empty

Summary I have found that inserting a class between an interface and another derived class results in the interface's default implementation being called rather than the derived implementation for the same method. This is unexpected behavior. Why is…
Victor Chelaru
  • 4,491
  • 3
  • 35
  • 49
16
votes
5 answers

Why dotnet --list-sdks does not show installed SDKs on Windows 10?

I have Microsoft .NET SDK 5.0.102 (x64) installed on my Windows 10, but when I do dotnet --list-sdks nothing shows up? I could see the SDK installed from Windows Apps & features. Thank you. Edit: Doing dotnet --info shows the following $ dotnet…
Ray
  • 12,101
  • 27
  • 95
  • 137
16
votes
2 answers

System.Text.Json Field Serialization in .NET 5 not shown in Swashbuckle API Definition

Problem I'm using ASP.NET Core with .NET 5 and am using the System.Text.Json serializer to serialize types containing fields (like System.Numerics.Vector3 (X, Y and Z are fields), although any type with fields behaves the same here). I've verified…
blenderfreaky
  • 738
  • 7
  • 26
15
votes
1 answer

Why is 'net6.0-windows' sub folder created?

I am using visual studio 2022 and created a winforms .net 6 application. I specified an output path for my release build where i want the .exe created, but visual studio creates a subfolder called 'net6.0-windows' and puts the exe in there. How do i…
Possibility
  • 153
  • 1
  • 5