小编典典

如何解决错误消息:“无法映射路径'/'。”

all

我在谷歌上搜索和搜索,我找不到任何似乎适用于我的情况的东西,更不用说解决问题了。我尝试导航到我网站中的哪个地址都没有关系(即使不存在的地址也会给出此错误而不是
404),我会收到完全相同的消息(路径始终为“/”)。有任何想法吗?

Server Error in '/' Application.

Failed to map the path '/'.

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 '/'.

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 '/'.]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +336

[HttpException (0x80004005): Failed to map the path '/'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11556592
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4813333

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

更新: 发布后几分钟我又回到了网站——没有更改代码或配置——错误就消失了。我真的很困惑,但这不再是问题。


阅读 53

收藏
2022-08-19

共1个答案

小编典典

我在 IIS 7 下遇到了同样的问题(MVC 4)。事实证明,App Pool 身份没有对站点路径的正确授权。

2022-08-19