当VS运行时,ASP.NET项目在构建中本地工作,但不在本地计算机或服务器上的IIS上工作

时间:2019-05-29 17:58:50

标签: c# asp.net iis iis-7.5 windows-server-2012-r2

我将asp.net(网络核心应用2.1)发布到了Windows 2012 r2的localhost :: 80。 它给了我以下错误:


HTTP错误500.19-内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效。

详细的错误信息: IIS Web核心模块 通知未知 处理程序尚未确定 错误代码0x8007000d 配置错误
配置文件\ web.config 要求的网址:80 / 物理路径
登录方法尚未确定 登录用户尚未确定


据我检查,错误似乎在web.config中 我将把web.config放在代码部分。

我尝试删除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>

我希望它会启动,但是发生的时候我得到了错误。 谢谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,我通过使用IIS管理器中的Web平台安装程序安装URL Rewrite解决了该错误。

相关问题