在IIS 7.5下工作的web.config在IIS 10下不起作用

时间:2021-07-23 02:26:13

I have an ASP.NET web site running under IIS 7.5 Works great.

我有一个在IIS 7.5下运行的ASP.NET网站。

Now we're experimenting with a new Windows 10 server, which runs IIS 10. Copied the identical web site to the new server and try to open it:

现在我们正在尝试运行IIS 10的新Windows 10服务器。将相同的网站复制到新服务器并尝试打开它:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.
...
Error Code     0x8007000d
...
Config Source:
  -1: 
   0: 

I looked up the error code:

我查了一下错误代码:

Cause: This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.

原因:出现此问题的原因是ApplicationHost.config文件或Web.config文件包含格式错误的XML元素。

Resolution: Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.

解决方案:从ApplicationHost.config文件或Web.config文件中删除格式错误的XML元素。

But that web.config file has been working for years. Nothing has changed. So I think that "malformed xml" message is a red herring, and there must be some other setting I'm missing.

但是那个web.config文件已经工作多年了。什么也没有变。所以我认为“格式错误的xml”消息是一个红色的鲱鱼,并且必须有一些我缺少的其他设置。

Any ideas?

1 个解决方案

#1


6  

I was running into the exact same issue and for me it was because I forgot to install Url Rewrite 2.0 for IIS, so my rewrite rules were causing the error. Not sure if this will be the same for you or not.

我遇到了完全相同的问题,对我来说这是因为我忘了为IIS安装Url Rewrite 2.0,所以我的重写规则导致了错误。不确定这对你是否相同。

I figured it out by commenting out blocks of the web.config until I got it to stop throwing that error.

我通过注释掉web.config的块来解决它,直到我得到它来停止抛出该错误。

Hope that helps!

希望有所帮助!

#1


6  

I was running into the exact same issue and for me it was because I forgot to install Url Rewrite 2.0 for IIS, so my rewrite rules were causing the error. Not sure if this will be the same for you or not.

我遇到了完全相同的问题,对我来说这是因为我忘了为IIS安装Url Rewrite 2.0,所以我的重写规则导致了错误。不确定这对你是否相同。

I figured it out by commenting out blocks of the web.config until I got it to stop throwing that error.

我通过注释掉web.config的块来解决它,直到我得到它来停止抛出该错误。

Hope that helps!

希望有所帮助!