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

.NET Core 3.1 application not building on Azure pipeline anymore (.NET 5)

Until recently our .Net Core 3.1 applications were building and publishing fine on Azure pipelines. But over the last couple of days the build pipelines have started to fail with the error: ##[error]C:\Program…
13
votes
2 answers

.Net 5 - WPF, unit test woes

I'm having some issues while playing around with .Net 5, so I'm hoping someone could shed some light on things. Having worked on a large enterprise .Net Framework solution for a number of years, .Net Core seems to have passed me by and I've had no…
Andrew Stephens
  • 9,413
  • 6
  • 76
  • 152
12
votes
1 answer

.Net 5 Azure Function App with use of Startup class

I have created an HTTP trigger-based .Net 5 Azure FunctionApp and trying to configure the database connection strings and dependency injections for my service classes but, I don't know how to call my configure method of Startup.cs file from…
Md Aslam
  • 1,228
  • 8
  • 27
  • 61
12
votes
2 answers

ASP.NETCORE use feature flags inside ConfigureServices

I'm using Feature Flags as described here. It works alright, I'm just wondering if the following is really the best way to use them if I want to switch between different service implementations inside ConfigureServices()? I have the following so…
silent
  • 14,494
  • 4
  • 46
  • 86
12
votes
2 answers

Why do Entity Framework Core migrations require .NET Core 2.x?

In my .NET5.0 project the PostgreSQL Nuget package is installed (Npgsql.EntityFrameworkCore.PostgrSQL (5.0.2)) and its dependency of EF Core (Microsoft.EntityFrameworkCore (5.0.2)). I'm trying to create a migration using this command: dotnet ef…
Krumelur
  • 32,180
  • 27
  • 124
  • 263
12
votes
2 answers

Where are the settings saved in a .NET 5 WinForms app?

In a .NET Framework WinForms project, there was an App.config file in the project, which was an XML file that contained a configSection that would reference a class in System.Configuration, and a section for the userSettings themselves, like…
Dave Slinn
  • 435
  • 6
  • 13
12
votes
2 answers

How do I define the SignedOut page in Microsoft.Identity.Web?

I'm successfully signing in and out using Azure AD B2C in a Blazor Server app, but it's not clear to me the proper way to define the SignedOut page. This question seems to be more applicable to Microsoft.Identity.Web.UI, because this SignedOut page…
12
votes
1 answer

How can I add the .NET framework 5.0 to Visual Studio Professional 2019?

I have downloaded and installed the new .NET framework 5.0 from this website. But I would like to know how to add this framework to a project created on Visual Studio 2019 16.8.0. Note: I have launched VS installer and I have searched for the new…
abdou_dev
  • 805
  • 1
  • 10
  • 28
12
votes
1 answer

.NET Core vs .NET 5.0

What is the difference between a .NET Core 3.1 application and a .NET 5.0 application? If I convert my .NET Core 3.1 application to .NET 5, will it still be a .NET Core application? I'm trying to understand if going from .NET Core 3.1 to .NET 5 is a…
Rich
  • 6,470
  • 15
  • 32
  • 53
12
votes
2 answers

Blazor Web Assembly App .Net Core Hosted: publish runtime error

I've created a simple Blazor Web Assembly project hosted inside a .NET Core App using .NET 5.0 RC1 Framework and I added the authorization during the wizard in Visual Studio 2019 Preview. It works perfectly in debug but if I publish it and try to…
11
votes
2 answers

Found .NET SDK, but did not find dotnet.dll

I recently installed Visual Studio 2022 preview. Today I was in a workshop and there was some feature that didn't work, and it turned out it was because I had the preview version of .NET 6 installed. So I then uninstalled Visual Studio 2022…
Svein Terje Gaup
  • 1,424
  • 15
  • 29
11
votes
1 answer

The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' was not found

Hi I create one WPF application using .Net 5.0 . It is working fine in my dev system . But when i try to copy and run bin folder to my windows 7 system , It is giving below error : The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' was…
Jophy job
  • 1,924
  • 2
  • 20
  • 38
11
votes
1 answer

LINQ to SQL not supported in .net 5.0?

My project used .NetFramework 4.6.2 with "LINQ to SQL" query from MSSQL. A class define all tables which are needed query in database and inheritance to DataContext(System.Data.Linq). Recently, I am going to upgrade the program to .net5.0. However,…
Vamos
  • 209
  • 2
  • 10
11
votes
1 answer

Mixing Blazor Components, DI and C# 8 nullable

I am using .net 5 for a Blazor app in a project with nullable enabled. It is using Code Behind to create Blazor Components. I want to use a constructor so that I can avoid marking every non DI property as nullable to simplify accessing them in my…
Nick Gelotte
  • 307
  • 4
  • 10
11
votes
1 answer

C# "anyString".Contains('\0', StringComparison.InvariantCulture) returns true in .NET5 but false in older versions

I encountered an incompatible problem while I was trying to upgrade my projects from .NET core 3.1 to the latest .NET 5. My original code has a validation logic to check invalid file name characters by checking each character returned from…
Ryo Asai
  • 1,088
  • 1
  • 6
  • 14