【发布时间】:2020-01-15 23:26:25
【问题描述】:
希望有人可以帮助解决这个问题:
我已在 Azure 上部署了我的 .NET Core 3.0 应用程序,即使它显示“发布成功”。应用程序未加载(http 500,服务器错误)。 Azure 中的“诊断和解决问题”选项卡指向模块“AspNetCoreModuleV2”,如图所示 Azure - Diagnose and solve problems
我试过了:
按照此处的建议安装 .NET 3.0 Runtime Hosting Bundle aspNetCore 2.2.0 - AspNetCoreModuleV2 error
将 web.config 文件中的
modules="AspNetCoreModuleV2"更改为modules="AspNetCoreModule",但一旦我发布应用程序,该文件就会恢复为原始值。将
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>添加到csproj,但没有任何区别,因此我已将其删除
这是我当前的csproj 文件:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.1.0-preview1-final" />
</ItemGroup>
</Project>
这就是我的web.config 文件的样子
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\SportsStore.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 3f1b616a-5c07-4b23-9c86-ec6506dc3fa7-->
顺便说一句,应用程序在本地机器上运行没有任何问题
非常感谢任何可以为我指明正确方向的帮助。
【问题讨论】:
标签: c# asp.net-mvc azure asp.net-core asp.net-core-3.0