部署 .NET Core ASP.NET 网站 - HTTP 错误 502.5 - 进程失败
Deploy .NET Core ASP.NET Website - HTTP Error 502.5 - Process Failure
我正在尝试将 Visual Studio 2015 的模板项目 "ASP.NET Core Web Application (.NET Framework)" 发布到 IIS。
我使用 Visual Studio 发布到文件系统功能。
我正在使用 Windows 10.
我遵循了 here 的指南。
- 我在 IIS 中设置了一个网站并将应用程序池 .NET CLR 版本更改为无托管代码
- 我安装了 .NET Core Windows 服务器托管包
- 我重新启动了我的机器。
我收到这个错误:
我添加了一个日志文件夹,但没有创建任何日志。
关于如何解决这个问题的任何想法?
编辑:
运行 来自 powershell 的 .exe 的输出:
PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe
托管环境:生产
内容根路径:C:\TestCoreWebsite
现在收听:http://localhost:5000
申请开始。按Ctrl+C关机。
然后我导航到 http://localhost:5000 并且示例站点工作。
找到解决方案:
在根 web.config 中更改:
processPath="%LAUNCHER_PATH%"
至:
processPath=".\Web_CoreWebNetFramework.exe"
我在cmd运行下面命令
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
在命令提示符下,这给了我一个更有意义的错误:
"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was
not found. - Check application dependencies and target a framework
version installed at: C:\Program
Files\dotnet\shared\Microsoft.NETCore.App - The following versions are
installed: 1.0.0 - Alternatively, install the framework version
'1.0.1'.
我安装了正确的 net core,项目运行正常
使用 VisualStudio 2017,打开 .csproj 文件并添加到第一个块:
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
通常结果是:
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
对于遇到与我相同问题的人(运行 在 VS 中很好,但在部署到本地 IIS 中时出现上述问题),我错过了设置环境变量并且在我添加设置环境变量后它起作用了
参考:
我正在尝试将 Visual Studio 2015 的模板项目 "ASP.NET Core Web Application (.NET Framework)" 发布到 IIS。
我使用 Visual Studio 发布到文件系统功能。
我正在使用 Windows 10.
我遵循了 here 的指南。
- 我在 IIS 中设置了一个网站并将应用程序池 .NET CLR 版本更改为无托管代码
- 我安装了 .NET Core Windows 服务器托管包
- 我重新启动了我的机器。
我收到这个错误:
我添加了一个日志文件夹,但没有创建任何日志。
关于如何解决这个问题的任何想法?
编辑:
运行 来自 powershell 的 .exe 的输出:
PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe 托管环境:生产 内容根路径:C:\TestCoreWebsite 现在收听:http://localhost:5000 申请开始。按Ctrl+C关机。
然后我导航到 http://localhost:5000 并且示例站点工作。
找到解决方案:
在根 web.config 中更改:
processPath="%LAUNCHER_PATH%"
至:
processPath=".\Web_CoreWebNetFramework.exe"
我在cmd运行下面命令
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
在命令提示符下,这给了我一个更有意义的错误:
"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found. - Check application dependencies and target a framework version installed at: C:\Program Files\dotnet\shared\Microsoft.NETCore.App - The following versions are installed: 1.0.0 - Alternatively, install the framework version '1.0.1'.
我安装了正确的 net core,项目运行正常
使用 VisualStudio 2017,打开 .csproj 文件并添加到第一个块:
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
通常结果是:
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
对于遇到与我相同问题的人(运行 在 VS 中很好,但在部署到本地 IIS 中时出现上述问题),我错过了设置环境变量并且在我添加设置环境变量后它起作用了
参考: