IISExpress VS.Net 2015-HTTP错误500.22-检测到ASP.NET设置不适用于集成托管管道模式 [英] IISExpress VS.Net 2015 - HTTP Error 500.22 - An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

查看:93
本文介绍了IISExpress VS.Net 2015-HTTP错误500.22-检测到ASP.NET设置不适用于集成托管管道模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地Win 10计算机上有一个 ASP.NET MVC5 Web应用程序.最近,我将一些Nuget软件包和MVC4升级到了MVC5.并将目标框架版本更新为.Net v4.5.

I've an ASP.NET MVC5 web app on my local Win 10 machine. Recently, I upgraded some Nuget packages and MVC4 to MVC5. And updated the target framework version to .Net v4.5.

现在,当我从本地VS.Net 2015社区版本调试Web应用程序时,出现以下错误-

Now, when I debug the web app from local VS.Net 2015 Community version I get the following error -

HTTP错误500.22-内部服务器错误ASP.NET设置已被执行 检测到不适用于集成托管管道模式.

HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

我发现的大多数线程都是针对IIS的,我所说的是IISExpress.他们建议在IIS( Post1 Post3 ).但是 VS.Net使用IISExpress ,所以我也对它进行了更深入的研究,并位于-C:\ Users \\ Documents \ IISExpress \ config \ applicationhost.config.试图对其进行编辑,但它只允许我配置一个WebSite1,它是localhost:8080,而我的运行方式是localhost:1960.

Most threads I found were for IIS I'm talking about IISExpress. They suggested to change the web app's App Pool to a Classic in IIS (Post1, Post2, Post3). But VS.Net uses IISExpress so I went deeper into that as well and located - C:\Users\\Documents\IISExpress\config\applicationhost.config. Tried to edit it but it would allow me to configure only one WebSite1 which is localhost:8080 and mine runs as localhost:1960.

我也尝试了 appcmd 命令行方法,但是除非我拥有网站"localhost:1960",否则似乎没有办法.我还寻求了IISExpress UI工具 Jexus ,但我的'localhost:1960'网站却没有列出.

I've also tried the appcmd commandline approach but unless I've a website 'localhost:1960' there seems no way. I also sought an IISExpress UI tool Jexus but my 'localhost:1960' website is not listed.

显然,设置

< validation validateIntegratedModeConfiguration ="false"/>中 web.config

<validation validateIntegratedModeConfiguration="false" /> in web.config

修复它.但这不是最好的解决方案.而且我无法从web.config中删除httpHandlers或模块.

fixes it. But its not the best solution. And I can't remove httpHandlers or modules from my web.config.

我需要知道如何在调试时操作VS.Net 2015调用的 IISExpress . 不是IIS .

I need to know how to manipulate the IISExpress that is invoked by VS.Net 2015 while debugging. Not IIS.

谢谢.

推荐答案

最后,我可以针对VS.Net 2015及其IISExpress的配置对其进行破解. IT人员无法在外部"对其进行配置,如果您继续在VS.Net外部修改IIS或IISExpress设置,则将无法进行任何操作.

Finally, I'm able to crack it for VS.Net 2015 and its configuration of IISExpress. ITs not possible to configure it 'externally' and nothing will work if you keep modifying IIS or IISExpress settings outside VS.Net.

我花了一些时间才将精力集中在VS.Net项目的属性和配置上.我发现VS.Net创建了自己的"applicationhost.config"版本,该版本位于-

It took me a while to narrow down my focus to VS.Net proj properties and configurations. I found that VS.Net created its own version of "applicationhost.config" which can be found at -

< myProject.sln路径> \ .vs \ config \ applicationhost.config

这是我必须在其中更改应用程序池的文件( applicationPool ="Clr4ClassicAppPool )-

This is the file in which I had to change the application pool (applicationPool="Clr4ClassicAppPool) -

    <sites>
        <site name="WebSite1" ... ignore this sction if present
        </site>
        <site name="myProject" id="2">
            <application path="/" applicationPool="Clr4ClassicAppPool">
                <virtualDirectory path="/" physicalPath="D:\Source\myProject" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:1960:localhost" />
            </bindings>
        </site>

您只需要更改applicationPool(在这种情况下,您的Classic App池名称可能会与diff相同).还要确保您更新的是正确的站点"节点(从VS.Net调试时,Web应用程序的正确localhost URL)

You just need to change the applicationPool (your Classic App pool name might be diff in that case get the correct one from in the same file). Also make sure you're updating the correct "site" node (the correct localhost url of your web app when debugged from VS.Net)

如果仍然有问题,请设置以下内容-

If still there's an issue set the following -

<applicationDefaults applicationPool="Clr4IntegratedAppPool" />

如果仍然存在问题,请在此文件中也进行上述更改-

If still there's an issue, make the above mentioned changes in this file as well -

C:\ Users \< youruser> \ Documents \ IISExpress \ config \ applicationhost.config

C:\Users\<youruser>\Documents\IISExpress\config\applicationhost.config

可能还需要重新启动.希望这会有所帮助.

Might need restart as well. Hope this helps.

这篇关于IISExpress VS.Net 2015-HTTP错误500.22-检测到ASP.NET设置不适用于集成托管管道模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆