首页 > 解决方案 > IIS 抛出配置文件错误 - 尝试部署 netcore2.0 应用程序时出现 0x8007000d

问题描述

我正在尝试将 netcore2.0 MVC 应用程序部署到 IIS 并不断收到上述错误。文件权限设置正确,我检查了运行时是否已下载。错误如下:

Module
IIS Web Core 

Notification
Unknown 

Handler
Not yet determined 

Error Code
0x8007000d 

Config Error
 

Config File
\\?\E:\Dev\test-deploy\web.config 


Requested URL
http://localhost:4231/ 

Physical Path

Logon Method
Not yet determined 

Logon User
Not yet determined 

以下是我的配置文件(由 vs 代码生成):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\Coneckt.Web.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 2833ed36-9a18-47b6-8f33-8998356796d9-->

标签: iis.net-core-2.0

解决方案


出现此错误是因为 ApplicationHost.config 或 Web.config 文件包含格式错误的 XML 元素,您需要从 ApplicationHost.config 或 Web.config 文件中删除格式错误的 XML 元素。

您还可以参考此链接了解如何在 IIS 上部署 ASP.NET Core:Host ASP.NET Core on Windows with IIS


推荐阅读