.net-5

What will happen to the Microsoft.AspNetCore.* namespace in ASP.NET 5.0?

痴心易碎 提交于 2021-01-07 03:35:27
问题 .NET 5.0 will replace .NET Core 3.x when it is released in November—and, thus, ASP.NET 5.0 will replace ASP.NET Core 3.x. Edit: This question is based on a fundamentally incorrect assumption. While the next version of .NET Core will, in fact, be .NET 5.0, the next version of ASP.NET Core will be ASP.NET Core 5.0. See the answers from @Camilo-Terevinto and @omajid for details. Despite this, as of Preview 8 (8.20414.8), packages, assemblies, and namespaces still contain AspNetCore in their

How to combine multiple authentication schemes for different types of clients (user/pass and client/secret) in a Blazor WASM project?

此生再无相见时 提交于 2021-01-05 08:53:38
问题 I have a Blazor WASM project with a Blazor Client and ASP.NET core server. I can authenticate with user/password using the following code: services .AddDefaultIdentity<ApplicationUser>( options => options.SignIn.RequireConfirmedAccount = true) .AddRoles<IdentityRole>() .AddEntityFrameworkStores<ApplicationDbContext>(); services .AddIdentityServer() .AddApiAuthorization<ApplicationUser, ApplicationDbContext>(); services .AddAuthentication() .AddIdentityServerJwt(); services.AddTransient

Building .NET 5.0 project Azure DevOps pipeline

怎甘沉沦 提交于 2021-01-02 05:41:14
问题 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 "-dl:CentralLogger,\"D:\a\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.178.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"*ForwardingLogger,\"D:\a\_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.178.0\dotnet-build-helpers

.NET 5 excludes some libraries from single file publication

て烟熏妆下的殇ゞ 提交于 2020-12-31 16:46:54
问题 I have a little problem with single file executable publish with .NET 5. Infact, it does not include all libraries in the executable file, and produces multiple files. In my example I'm using a library for SQLite (Microsoft.Data.Sqlite) and, after compilation, e_sqlite3.dll is not included. Instead, in the output folder, it produces two files (excluding the pdb file): > e_sqlite3.dll > WpfApp1.exe 回答1: By reading documentation Single-file doesn't bundle native libraries by default. On Linux,

.NET 5 excludes some libraries from single file publication

拥有回忆 提交于 2020-12-31 16:42:30
问题 I have a little problem with single file executable publish with .NET 5. Infact, it does not include all libraries in the executable file, and produces multiple files. In my example I'm using a library for SQLite (Microsoft.Data.Sqlite) and, after compilation, e_sqlite3.dll is not included. Instead, in the output folder, it produces two files (excluding the pdb file): > e_sqlite3.dll > WpfApp1.exe 回答1: By reading documentation Single-file doesn't bundle native libraries by default. On Linux,

.NET 5 excludes some libraries from single file publication

你离开我真会死。 提交于 2020-12-31 16:37:16
问题 I have a little problem with single file executable publish with .NET 5. Infact, it does not include all libraries in the executable file, and produces multiple files. In my example I'm using a library for SQLite (Microsoft.Data.Sqlite) and, after compilation, e_sqlite3.dll is not included. Instead, in the output folder, it produces two files (excluding the pdb file): > e_sqlite3.dll > WpfApp1.exe 回答1: By reading documentation Single-file doesn't bundle native libraries by default. On Linux,

Azure Devops - Compatibility problems moving from .NET Core 3.1 to .NET 5 at Nuget Package

孤人 提交于 2020-12-12 09:10:30
问题 I have a .NET Core solution which was running well using .NET Core 3.1 using a Pipeline on Azure Devops. Everything was working fine on the Pipeline. After moving from .NET Core 3.1 to .NET 5.0, I started to have some strange troubles running the pipeline, specifically with Nuget packages. I can build with no problems, but when it starts to pack using Nuget Package, I've got this error: [error] The nuget command failed with exit code(1) NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is

Some C# 9 features not available after upgrading Asp.Net Core 3.1 app to .Net 5

烂漫一生 提交于 2020-12-12 05:39:32
问题 I've upgraded an Asp.Net Core 3.1 (MVC) to .Net 5 by modifying the corresponding *.csproj file to this: <TargetFramework>net5.0</TargetFramework> <LangVersion>9.0</LangVersion> Now I can use the C# 9 target typing feature... string s = new('c', 3); // compiles fine ...but I can't create a record class: public data class User { // IDE1007 The name 'data' does not exist in the current context. } Am I missing something here? 回答1: According to record type specs, you should use public record User

Some C# 9 features not available after upgrading Asp.Net Core 3.1 app to .Net 5

你离开我真会死。 提交于 2020-12-12 05:38:21
问题 I've upgraded an Asp.Net Core 3.1 (MVC) to .Net 5 by modifying the corresponding *.csproj file to this: <TargetFramework>net5.0</TargetFramework> <LangVersion>9.0</LangVersion> Now I can use the C# 9 target typing feature... string s = new('c', 3); // compiles fine ...but I can't create a record class: public data class User { // IDE1007 The name 'data' does not exist in the current context. } Am I missing something here? 回答1: According to record type specs, you should use public record User

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

僤鯓⒐⒋嵵緔 提交于 2020-11-29 07:52:11
问题 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 these libraries to latest version using .Net Core 3.1 project. Can I update to v5.0.0 libraries even if I'm using/building a .Net Core 3.1 project? 回答1: Unfortunately, you cannot update many of these newest Nuget packages to 5.0. The reason being is