[英]ASP.NET project works locally on build when VS is running but not on IIS on my local machine or my server
I published my asp.net (net core app 2.1) to windows 2012 r2 at localhost::80.我在 localhost::80 上将我的 asp.net(net core app 2.1)发布到了 windows 2012 r2。 It gives me the following error:
它给了我以下错误:
HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. HTTP 错误 500.19 - 内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效。
Detailed Error Information: Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x8007000d Config Error详细错误信息:模块 IIS Web 核心通知未知处理程序尚未确定错误代码 0x8007000d 配置错误
Config File \\web.config Requested URL :80/ Physical Path配置文件 \\web.config 请求的 URL :80/ 物理路径
Logon Method Not yet determined Logon User Not yet determined登录方法 尚未确定 登录用户 尚未确定
As far as I checked, the error seems to be in web.config I'll put the web.config in the code section.据我检查,错误似乎在 web.config 中,我会将 web.config 放在代码部分。
I have tried deleting the web.config and enabling directory browsing, making an index.html load index.cshtml but that won't work because MVC.我尝试删除 web.config 并启用目录浏览,使 index.html 加载 index.cshtml 但这不起作用,因为 MVC。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<modules>
<!-- Remove WebDAV module so that we can make DELETE requests -->
<remove name="WebDAVModule" />
</modules>
<handlers>
<!-- Remove WebDAV module so that we can make DELETE requests -->
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<!-- When deploying on Azure, make sure that "dotnet" is installed and the path to it is registered in the PATH environment variable or specify the full path to it -->
<aspNetCore requestTimeout="23:00:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600">
<environmentVariables />
</aspNetCore>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
I expected it to start but as it happens I get the error.我希望它开始,但碰巧我收到错误。 Thank you for your help.
感谢您的帮助。
我遇到了同样的错误,我通过使用 IIS 管理器中的 Web 平台安装程序安装 URL 重写来解决它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.