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
15
votes
2 answers

Superfluous 'runtimes' folder created in output directory for .NET 5 project

I've just migrated a (WPF) .NET 4.6 project to .NET 5. I've noticed it is now creating a folder called 'runtimes' in the output directory with lots of platform-dependent dlls. Since this app will only run on Windows machines, is there anyway of…
maxp
  • 24,209
  • 39
  • 123
  • 201
15
votes
1 answer

Using Azure Function .NET5 and HttpRequestData, how to handle file upload (form data)?

The older Azure Function gives access to HttpRequest, which allows us to access the uploaded files via req.Form.Files etc. The isolated .NET5 Azure Function uses HttpRequestData instead, which does not give access to the Form. How do I extract the…
thankyoussd
  • 1,875
  • 1
  • 18
  • 39
15
votes
7 answers

Cannot find .NET 5.0 Console App project template in Visual Studio 2019

I'm currently trying to create a C# .NET 5.0 Console Application in Visual Studio 2019, and the option does not appear under project templates as I expect it to. I downloaded Visual Studio Professional 2019 Version 16.9.4 (from…
Richard Chang
  • 151
  • 1
  • 4
15
votes
2 answers

Upgrading Azure Function From 3.1 to .Net 5 Give "GenerateFunctionMetadata" task could not be loaded

I'm trying to update Azure Function from 3.1 to .Net 5. I am following the below article https://codetraveler.io/2021/02/12/creating-azure-functions-using-net-5/ I created a new Time Triggered Function version 3.1 and followed the above…
Sid.Hart
  • 151
  • 1
  • 5
15
votes
1 answer

Enable Systemd in WSL 2

I am attempting to debug some C# / .NET 5 code in WSL 2 with Ubuntu on Windows. I have WSL 2 setup with Windows 10 and want to test out creating a Systemd service. Unfortunately, it appears Systemd is not enabled with WSL 2 by default, even though a…
jjxtra
  • 20,415
  • 16
  • 100
  • 140
15
votes
2 answers

JsonPropertyNameAttribute is not supported record from C#9?

I want to use record with JsonPropertyName attribute, but it caused an error. This is not supported? Any workaround? public record QuoteResponse([JsonPropertyName("quotes")] IReadOnlyCollection? Quotes); Error CS0592 Attribute…
Dmitry
  • 1,095
  • 14
  • 21
15
votes
1 answer

Blazor WebAssembly App with docker support (linux)

Today I have a question which is one of those questions, that you always did want to know but you were always afraid to ask;) But this question is also correlated with BlazorWebAssembly app docker support. So maybe I will describe what I did. SO I…
Piotr
  • 1,155
  • 12
  • 29
15
votes
3 answers

Can I update to .Net 5 NuGet packages even if I'm using .Net Core 3.1?

I was looking for some NuGet updates about my project libraries. I see that there are a lot of Microsoft libraries update to v5.0.0. Based on my knowledge I think these are new dependencies released with .Net 5.0 and I'm not sure that I can update…
E.Benedos
  • 1,585
  • 14
  • 41
15
votes
4 answers

net 5.0 Cannot determine the frame size or a corrupted frame was received

I want to try net5.0 since it's in rc2, and I've encountered a strange issue. I've created a default WebApi in net5.0. I didn't touch anything, I just clicked run (in kestrel, not ISS) and the Swagger home page shows up. I tried the WeatherForcast…
Thibaud
  • 377
  • 1
  • 2
  • 15
14
votes
2 answers

error MSB3823: Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true

Hello everyone I got an error and I`m trying to solve it I found some similar source but could not solve my problem. Similar problem like here. I compile my project .csproj file using .bat file actually it is .batch file from cmd. But I got this…
Rifat Murtuza
  • 1,151
  • 2
  • 7
  • 15
14
votes
1 answer

SetBasePath not present in ConfigurationBuilder under .NET Core 5

According to the docs for .NET Core 5, there's a method SetBasePath and it's widely used in a bunch of blogs (example 1, example 2, example 3 etc.). There's no notion of it being a weird gotcha or such. However, when I try the syntax below, it's…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
14
votes
2 answers

string.IndexOf returns different value in .NET 5.0

When I run the following code in .NET Core 3.1, I get 6 as the return value. // .NET Core 3.1 string s = "Hello\r\nworld!"; int idx = s.IndexOf("\n"); Console.WriteLine(idx); Result: 6 But when I run this code in .NET 5.0, I get a different…
Farhad Zamani
  • 5,381
  • 2
  • 16
  • 41
14
votes
2 answers

How to solve the Error MSB3644 in Visual Studio 2019 com. edition?

I have a dev machine with Windows 10 version 1909 (build 18363.1016) Visual Studio Community edition 2019 version 16.7.2 .net plataform sdk 5.0.100-preview.5.20279.10 (and olders) I install net plataform sdk 5.0 to run Fluid UI Desktop apps (using…
Pedro Polonia
  • 2,604
  • 3
  • 23
  • 31
13
votes
3 answers

Azure Function Middleware: How to return a custom HTTP response?

I am exploring Azure Function running on .net 5 and I found out about the new middleware capabilities. I have built a dummy middleware like this one: public sealed class ExceptionLoggingMiddleware : IFunctionsWorkerMiddleware { private readonly…
Kzryzstof
  • 7,688
  • 10
  • 61
  • 108
13
votes
1 answer

Reference a .NET 5.0 assembly from a full framework project?

We're a bit behind the times with all our products (WPF applications) still using v4.6.1. I'm currently having a "play" with .NET 5, and have converted one of our class libraries (used by many of these products) to v5. I'm now attempting to…
Andrew Stephens
  • 9,413
  • 6
  • 76
  • 152