我已经将应用程序从ASP.NET Core v1.1更新为ASP.NET Core 2.0。
在我的开发机上一切正常。但是当我部署到Azure时,我得到"HTTP Error 502.5 - Process Failure"
了回应。
我已经在web.config中激活了日志记录:
<aspNetCore processPath=".\PublicWeb2.Web.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
日志显示:
无法初始化CoreCLR,HRESULT:0x80004005
如果我dotnet mysite.dll
从Kudo中的命令提示符运行,则会收到相同的错误。
Azure中的事件日志给出以下错误:
具有物理根目录'D:\ home \ site \ wwwroot \'的应用程序'MACHINE / WEBROOT / APPHOST / XXXXX'无法使用命令行'D:\ home \ site \ wwwroot \ XXX'启动进程,ErrorCode ='0x80004005:80008089。
相关的Azure设置:
我完整的csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>XXXXXXXXXXX</UserSecretsId>
<RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
<WebProject_DirectoryAccessLevelKey>1</WebProject_DirectoryAccessLevelKey>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MarkdownWeb" Version="1.3.4" />
<PackageReference Include="MarkdownWeb.Git" Version="1.0.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XXX\XXX.csproj" />
</ItemGroup>
</Project>
云服务上安装的Dotnet版本:
D:\home\site\wwwroot>dotnet --info
.NET Command Line Tools (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Windows
OS Version: 6.2.9200
OS Platform: Windows
RID: win8-x86
Base Path: D:\Program Files (x86)\dotnet\sdk\2.0.0\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
我所做的(通过阅读其他SO问题):
win7-x86
在我的csproj中添加为第一个运行时标识符COREHOST_TRACE=1
激活,但是控制台挂起了工藤(并且管道到日志不起作用,即dotnet myapp.dll > mylog.txt
)我不知道下一步该怎么做。
终于成功了。
在该Web项目的csproj文件中,我删除了该<RuntimeIdentifiers>
元素(<RuntimeIdentifier>
如果您指定了单个运行时)。
<RuntimeIdentifier>
在发布配置文件中删除。可以在解决方案资源管理器中找到pubxml
Project -> Properties -> PublishProfiles -> yourfilename.pubxml.
删除以下行(已指定运行时)
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
保存文件并关闭它。
下次运行publish命令时,在Settings
选项下应显示“ portable” :
那对我有用。
因此,我的猜测是真正的解决方案是:
RuntimeIdentifier
在发布配置文件中未指定任何编号RuntimeIdentifier
在csproj文件中未指定任何编号本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句