ASP.NET - 无法映射路径 '/myappname'

3
我在Windows Server 2008 R2上尝试在IIS 7.5中设置新应用程序时,遇到了一个非常烦人的错误。
我在IIS 7.5的默认网站下添加了一个名为myappname的新应用程序。
我已将应用程序池设置为ASP.NET v4.0
我尝试从同一服务器上不同网站上正常工作的另一个应用程序中复制文件,但仍然失败,因此我认为它与web.config设置无关。
如果我浏览http://localhost/myappname(或浏览该应用程序下的任何文件/路径),则会出现以下错误:

Server Error in '/myappname' Application.

Failed to map the path '/myappname'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Failed to map the path '/myappname'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Failed to map the path '/myappname'.]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +336

[HttpException (0x80004005): Failed to map the path '/myappname'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700992
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4869221
我真的不明白。此外,如果我进入“编辑应用程序”对话框并使用“测试设置”按钮,则会出现错误:

“执行此操作时发生错误。详细信息:无效的应用程序路径”

这是胡说八道,因为我使用...按钮浏览路径来选择路径。

此外,在服务器上的一些可用网站上使用“测试设置”按钮时也会出现同样的错误,所以我不确定如何处理该错误或者它是否相关。

1个回答

1

从问题中无法清楚地了解您的问题。我可以建议以下解决方案。尽力而为

1.检查您的应用程序池是否在集成模式下运行。
2.如果映射了默认路由,则尝试右键单击IIS中的应用程序=>管理应用程序=>浏览
3.尝试在global.asax中的Application_Start()中添加RegisterRoutes(RouteTable.Routes);


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接