本文介绍了在IIS上运行.NET Core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在本地计算机上设置IIS以运行.NET Core API。我按照文章。我将代码(使用dotnet发布)发布到临时文件夹,并在IIS上设置为使用此临时文件夹。

I tried to set up IIS on my local machine to run .NET Core API. I followed https://docs.microsoft.com/en-us/aspnet/core/publishing/iis article. I published code (using dotnet publish) to temp folder and on IIS set up to use this temp folder.

我收到HTTP错误502.5 - 浏览器中的进程失败错误。

I'm getting HTTP Error 502.5 - Process Failure error in browser.

在事件日志中出现错误:

In event logs there is an error:

我将.NET Core从1.0升级到1.1,创建了新的应用程序池(.NET CLR Version No Mananged Code),安装了所有必需的更新, web.config已创建并且看起来不错,但仍无法正常工作。
我在这里发现了一些帖子,但他们对我没有帮助。

I upgraded .NET Core from 1.0 to 1.1, created new application pool (.NET CLR Version No Mananged Code), installed all required updates, web.config is created and looks good, but still doesn't work.I found some posts here but they didn't help for me.

有没有人有同样的问题?

Does anyone have same issue?

推荐答案

你有 Microsoft.AspNetCore.IISIntegration.Tools 在project.json下的工具部分?

Do you have "Microsoft.AspNetCore.IISIntegration.Tools" in project.json under the tools section?

它应该是这样的;

"tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

web.config framewokr中的另一个问题可能找不到dotnet.exe;
在web.config中尝试此操作;

Maybe another problem in web.config framewokr can not find dotnet.exe;Try this in web.config;

<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\YourNetCoreProject.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

而不是LAUNCHER_PATH和LAUNCHER_ARGS

instead of LAUNCHER_PATH and LAUNCHER_ARGS

这篇关于在IIS上运行.NET Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 20:18