asp.net-core-5.0

Migrating One-to-Many to Many-to-Many with the new EF Core 5.0

谁说我不能喝 提交于 2021-02-11 14:22:38
问题 I have an ASP.NET Core 5 project (migrated from ASP.NET Core 3.1). The project uses EF Core. EF Core 5 has built-in support for Many-to-Many. The main reason I first migrated from 3.1 to 5.0. Now my project has a One-to-Many relationship, which I want to convert to a Many-to-Many. Is such a relationship migration possible? Current code: public class File { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public int Id { get; set; } [DatabaseGenerated(DatabaseGeneratedOption

Deploy ASP.NET Core 5 app to Azure App Service?

雨燕双飞 提交于 2021-02-04 13:08:22
问题 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 Studio, however, I receive the following error: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Specific error

Deploy ASP.NET Core 5 app to Azure App Service?

此生再无相见时 提交于 2021-02-04 13:07:55
问题 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 Studio, however, I receive the following error: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Specific error

Disable precompiled views on development when using “AddControllersWithViews()”

懵懂的女人 提交于 2021-01-27 16:35:35
问题 I am developing ASP.NET Core 5.0.1 project and I want to know how can I disable precompiled views while I developing. It takes long time to reload page if I change some html code and I don't want that. I know it is useful at product but I want to disable on development. Anyone can help me? UPDATE app.csproj <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> </Project> Startup.cs public class Startup { public void ConfigureServices

Disable precompiled views on development when using “AddControllersWithViews()”

空扰寡人 提交于 2021-01-27 16:32:23
问题 I am developing ASP.NET Core 5.0.1 project and I want to know how can I disable precompiled views while I developing. It takes long time to reload page if I change some html code and I don't want that. I know it is useful at product but I want to disable on development. Anyone can help me? UPDATE app.csproj <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> </Project> Startup.cs public class Startup { public void ConfigureServices

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 add html using Razor templates from database to views at runtime

江枫思渺然 提交于 2021-01-07 01:37:08
问题 In ASP.NET Core 5 MVC shopping cart application users can change shipping price calculation, discount options and other such things at runtime. They are editing Razor templates in text editor outside Visual Studio and outside application using non .NET application. Those templates are saved in database. Views contain hook calls: @inherit ViewPageBase<object> <head> @Hook(ElementName.BeforeHeadContent) ... <body> @Hook(ElementName.Body) ... @Hook(ElementName.Footer) ... </body> Hook method is

How to add html using Razor templates from database to views at runtime

*爱你&永不变心* 提交于 2021-01-07 01:36:54
问题 In ASP.NET Core 5 MVC shopping cart application users can change shipping price calculation, discount options and other such things at runtime. They are editing Razor templates in text editor outside Visual Studio and outside application using non .NET application. Those templates are saved in database. Views contain hook calls: @inherit ViewPageBase<object> <head> @Hook(ElementName.BeforeHeadContent) ... <body> @Hook(ElementName.Body) ... @Hook(ElementName.Footer) ... </body> Hook method is

How to force ASP.NET Core 5 source code to not be optimized

大城市里の小女人 提交于 2021-01-02 18:10:51
问题 I'm trying to debug the Antiforgery code in the ASP.NET Core 5 framework. I have built the code successfully using the instructions in https://github.com/dotnet/aspnetcore/blob/master/docs/BuildFromSource.md using the Debug configuration. I have added the source code project to my test project and referenced it. I've checked that the Configuration is set to Debug. I've made sure that "Suppress JIT Optimizations" has been checked. "Optimize Code" in Project Properties -> Build, is unchecked

How to force ASP.NET Core 5 source code to not be optimized

别等时光非礼了梦想. 提交于 2021-01-02 18:09:51
问题 I'm trying to debug the Antiforgery code in the ASP.NET Core 5 framework. I have built the code successfully using the instructions in https://github.com/dotnet/aspnetcore/blob/master/docs/BuildFromSource.md using the Debug configuration. I have added the source code project to my test project and referenced it. I've checked that the Configuration is set to Debug. I've made sure that "Suppress JIT Optimizations" has been checked. "Optimize Code" in Project Properties -> Build, is unchecked