简体   繁体   English

HTTP 错误 500.19 - IIS Express 中的内部服务器错误?

[英]HTTP Error 500.19 - Internal Server Error in IIS Express?

My ASP.NET site is working well in VS 2015.我的 ASP.NET 站点在 VS 2015 中运行良好。

But I have published it to IIS Express in Window 7, displays the below error.但我已将其发布到 Window 7 中的 IIS Express,显示以下错误。 在此处输入图片说明

That is my IIS Express config.那是我的 IIS Express 配置。 在此处输入图片说明

What's my wrong?我怎么了?

If you google your error, literally first result is this support page如果你用谷歌搜索你的错误,第一个结果就是这个支持页面

And the very first entry is:第一个条目是:

HResult code 0x8007000d HResult 代码0x8007000d

Error message :错误信息
Server Error in Application "application name" Cause HTTP Error 500.19 – Internal Server Error HRESULT: 0x8007000d The requested page cannot be accessed because the related configuration data for the page is invalid.应用程序“应用程序名称”中的服务器错误 原因 HTTP 错误 500.19 – 内部服务器错误 HRESULT: 0x8007000d 无法访问请求的页面,因为该页面的相关配置数据无效。

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 元素。

So either in the very begining of your file you have some chars that should not be here , or you XML is just malformed.因此,要么在文件的最开始,您就有一些不应该出现在此处的字符,要么您的 XML 格式不正确。

Try including runAllManagedModulesForAllRequests="true" for the modules tag inside <system.webServer> tag of your web config file.尝试将 runAllManagedModulesForAllRequests="true" 包含在 web 配置文件的<system.webServer>标签内的模块标签中。

An example :一个例子 :

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>

and if the issue still exists try logging the issue as mentioned in如果问题仍然存在,请尝试记录中提到的问题

https://blogs.iis.net/rickbarber/working-past-500-internal-server-error https://blogs.iis.net/rickbarber/working-past-500-internal-server-error

First, in VS you are using IIS Express, but the second screen shot shows IIS Manager, which means you are deploying the web app to IIS.首先,在 VS 中,您使用的是 IIS Express,但第二个屏幕截图显示的是 IIS 管理器,这意味着您正在将 Web 应用程序部署到 IIS。 IIS and IIS Express are different in far too many ways. IIS 和 IIS Express 在很多方面都不同。

Second, the error page shows an error on line -1, which in most cases indicates a missing out-of-band module.其次,错误页面在第 -1 行显示错误,这在大多数情况下表示缺少带外模块。 Please go to http://iis.net to install them.请到http://iis.net安装它们。 Examples are, URL Rewrite module, ARR, and so on.例如,URL 重写模块、ARR 等。

You can use Jexus Manager to verify as it can show more accurate error message than IIS Manager if a configuration error is detected.您可以使用 Jexus Manager 进行验证,因为如果检测到配置错误,它可以显示比 IIS Manager 更准确的错误消息。

https://www.jexusmanager.com https://www.jexusmanager.com

Try to run the visual studio in Administrator mode.尝试以管理员模式运行 Visual Studio。 if not works, try to change the port of the iis express it may solve the issues.如果不行,尝试更改iis express的端口可能会解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM