【发布时间】:2017-11-01 00:51:25
【问题描述】:
我在将 .NET Core 2.0 项目部署到 IIS 时遇到问题
我按照此处列出的说明进行操作: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors
当我尝试通过浏览器访问我已发布的项目时,我收到此错误 留言
查看我的 IIS 服务器上的事件查看器,我看到以下错误
我安装了 .NET SDK,因此 dotnet 命令可在终端上使用。
我添加了一个 global.json 文件,该文件根据此链接中的说明指定了正确的 dotnet SDK:https://github.com/aspnet/JavaScriptServices/issues/495,但这并没有解决问题。
如何将我的 .NET Core 2.0 WebAPI+Angular4 项目发布到 IIS?
编辑:
我可以使用dotnet MPMWebsiteLogins.dll手动启动应用程序
编辑 2:
我更新了 web.config 并明确指定了 dotnet.exe 和 MPMWebsiteLogins.dll 的路径
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments="C:\inetpub\WebApps\HPIssuesUtilityV2\MPMWebsiteLogins.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
我现在在我的事件查看器中收到此错误:
Application 'MACHINE/WEBROOT/APPHOST/MPMWEBSITELOGINS' with physical root 'C:\inetpub\WebApps\HPIssuesUtilityV2\' created process with commandline 'C:\Program Files\dotnet\dotnet.exe C:\inetpub\WebApps\HPIssuesUtilityV2\MPMWebsiteLogins.dll' but failed to listen on the given port '1989'
【问题讨论】:
-
如果你只运行
dotnet MPMWebsiteLogins.dll,输出是什么? -
@Kirk 应用程序在
dotnet MPMWebsiteLogins.dll下运行得很好 -
对于原始问题 - 您需要将
dotnet.exe所在的路径添加到您的 System PATH 环境变量中,并且您必须重新启动服务器。对于端口问题 - 可能某些东西(甚至可能是您自己的应用程序)正在使用此端口。确保您没有运行任何使用此端口的程序。如果这是开发机器,请停止 IISExpress(从托盘/通知区域)
标签: angular iis asp.net-core