我有一个小型 webapi 服务,它可以在 Visual Studio 下工作,但不能在 IIS 下工作。
我做了下一步:
- 新应用程序已添加到 IIS 控制台中的默认网站。
- 应用程序通过文件系统从 VS 发布到应用程序文件夹中
(选择了依赖框架和可移植选项)。
当我尝试使用我的应用程序访问文件夹时(例如http://localhost/example/
) 我收到500.19
代码错误0x8007000d
。我读到如果ApplicationHost.config
or Web.config
有错误的 XML 选项。我使用默认的Web.config
file (ApplicationHost.config
我没有使用)VS 生成的,我不明白其中有什么问题。这是我的Web.config
file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Service.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
Lex Li 写了一篇很棒的文章:https://blog.lextudio.com/the-horrible-story-of-publishing-net-core-web-apps-for-beginners-6121662dd8c4 https://blog.lextudio.com/the-horrible-story-of-publishing-net-core-web-apps-for-beginners-6121662dd8c4,其中描述了发布 .NET Core Web 应用程序的问题。
就我而言,我没有安装 ASP.NET Core Hosting Bundle。很难找到一个简单的解决方案,因为很难理解应该搜索什么。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)