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
30
votes
5 answers

Blazor CSS Isolation not working and not adding scope identifiers after migrating to .NET 5.0 and using SASS

I've recently migrated a pet project from Blazor .NET 3.1 to .NET 5.0 and am trying to switch to using css isolation. I've created a scss file (which compiles to a css file using the webcompiler extension) with the same prefix as my component: I've…
Matthew Conradie
  • 990
  • 2
  • 8
  • 17
30
votes
2 answers

Migrating from .NET Core 3.1 to .NET 5 produce compile-time error

I have .netcore 3.1 application and I want to update it to .net 5.0 I have the following code public static IAppSettings ConfigureAppSettings(this IServiceCollection services, IConfiguration configuration) { void ConfigureSection
Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
29
votes
4 answers

Building .NET 5.0 project Azure DevOps pipeline

I'm trying to build a project in .NET 5.0 using Azure DevOps pipeline Build and I'm received this error 2020-11-14T01:59:45.8238544Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\XXX.csproj…
Danillo Parreira
  • 415
  • 1
  • 4
  • 6
28
votes
2 answers

CA1416. How to tell builder that only platform is Windows?

dotnet run (on windows) causes warning CA1416: This call site is reachable on all platforms. 'WellKnownSidType.WorldSid' is only supported on: 'windows'. My program is designed to run only on windows. I tried to add SupportedPlatform to…
filimonic
  • 3,988
  • 2
  • 19
  • 26
28
votes
4 answers

Blazor EventCallback with Multiple Params - how to respond to event in parent host control

I have a blazor component with an EventCallBack parameter that utilized the new struct format allowing multiple arguments [Parameter] public EventCallback<(EmployeeShiftDay, DateTime, DateTime)> NewDayScrolledIntoView { get; set; } eventcallback is…
Laurence73
  • 1,182
  • 1
  • 10
  • 14
28
votes
4 answers

Can I add a reference to a .NET Framework DLL from a .NET 5 project?

Microsoft recently announced at Build 2019 that the next major version of .NET will unify both .NET Core 3.* and .NET Framework 4.* into a single .NET platform, which the major version number will be 5. I didn't understand it well, does it mean that…
lmcarreiro
  • 5,312
  • 7
  • 36
  • 63
26
votes
5 answers

Can't get query parameter from HttpRequestData

I'm upgrading my code from .NET 3.0 to .NET 5.0, this changes the sintaxis quite a bit. In my previous code, which is a http request build in AZURE FUNCTIONS .NET 5.0 isolate, builds an GET api that takes parameters. This is my previous code from…
25
votes
3 answers

Migrate .NET Framework 4.8 to .NET 5

Recently Microsoft has release .NET 5. If we want to upgrade .NET Framework 4.8 to .net 5 then how can we accomplish this task. Please Note : I had already upgrade Visual Studio 18.2 with all latest component and .net Framework 5. But in project…
Dave Kapildev
  • 471
  • 1
  • 7
  • 18
25
votes
5 answers

How to disable precompiled views in net core 2.1+ / net 5 for debugging?

Yesterday I updated to net core 2.1. Now if I am debugging, the views getting precompiled, which ofcourse takes a long time during startup... Is it possible to fall back to the previous behavior, where the Views are compiled just in time, if it is…
Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111
24
votes
2 answers

How to use default serialization in a custom System.Text.Json JsonConverter?

I am writing a custom System.Text.Json.JsonConverter to upgrade an old data model to a new version. I have overridden Read() and implemented the necessary postprocessing. However, I don't need to do anything custom at all in the Write()…
dbc
  • 104,963
  • 20
  • 228
  • 340
24
votes
4 answers

What is difference between Init-Only and ReadOnly in C# 9?

I am going through C# 9 new features which will be released soon. Init-Only properties are being introduced with it. The one big limitation today is that the properties have to be mutable for object initializers to work: They function by first…
Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
23
votes
2 answers

Adding configuration to windows forms on .NET 5.0

I'm migrating an existing windows forms C# app to .NET 5.0 and I'm trying to follow the instrutions presented on the migration docs. Everything is working ok, but there's still one thing to do: migrate the debug/release settings from app.config…
Luis Abreu
  • 4,008
  • 9
  • 34
  • 63
23
votes
3 answers

How to migrate a .Net standard project to .Net 5 in VS.net solution?

I have a VS solution that contains both .Net CORE and .Net standard projects. I have just changed all the .Net CORE projects to use .Net 5 by switching the Target Framework property as below But I can't do the same with the .Net standard projects…
Alexu
  • 1,015
  • 2
  • 12
  • 32
22
votes
1 answer

Ping Tasks will not complete

I am working on a "heartbeat" application that pings hundreds of IP addresses every minute via a loop. The IP addresses are stored in a list of a class Machines. I have a loop that creates a Task (where MachinePingResults is…
davidsbro
  • 2,761
  • 4
  • 23
  • 33
22
votes
1 answer

How do I generate .proto files or use 'Code First gRPC' in C#

I want to use gRPC with .NET in an asp.net core web application. How do I generate the necessary .proto file from an existing C# class and model objects? I don't want to re-write a .proto file that mirrors the existing code, I want the .proto file…
jjxtra
  • 20,415
  • 16
  • 100
  • 140