我有一个ASP.NET MVC Web应用程序,该应用程序作为iis上的新站点托管。我还有另一个ASP.NET Web API,需要将其作为应用程序托管在MVC应用程序下。但是,当我托管并尝试访问Web API时,出现以下错误。
但是,当我在iis上将Web Api托管为其他站点时,它可以正常工作。关于如何解决这个想法?
通过在Asp.net MVC应用程序的web.config文件中设置InheritInChildApplications =“ false”,可以解决此问题。
<location path="." inheritInChildApplications="false">
<system.web></system.web>
</location>
<location path="." inheritInChildApplications="false">
<system.webServer></system.webServer>
</location>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句