我在谷歌上搜索了又搜索,但我找不到任何似乎适用于我的情况的东西,更不用说解决问题了.无论我try 在我的网站中导航到哪个地址(即使不存在的地址也会给出这个错误,而不是404),我都会得到完全相同的消息(路径总是"/").有什么 idea 吗?

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

UPDATE:在发布这篇文章几分钟后,我回到了这个站点--没有对代码或配置进行任何更改--错误消失了.我真的很困惑,但这不再是问题了.

推荐答案

在iis7下,我也遇到了同样的问题(mvc4).事实证明,应用程序池标识没有对网站路径的正确授权.

Asp.net相关问答推荐

判断 asp.net mvc 4 应用程序中的 ssl 协议、密码和其他属性

说服遗留应用程序 VB6 开发人员切换到 C#

WebAPI 请求流支持

更新到 ASP.NET Core 2.0 - 包与 netcoreapp2.0 不兼容

将命令行参数传递给 ASP.NET Core 中的 Startup 类

Devexpress 或 Telerik Controls 比较

UseSqlServer 方法缺少 MVC 6

免费的 ASP.Net 和/或 CSS 主题

以编程方式添加跨度标签,而不是标签控件?

VirtualPath 在当前应用程序根目录之外

ASP.NET 中的多选下拉列表

在 ASP.NET 4.5 WebForms 中通过 bundle.config 与 BundleConfig.cs Bundle 资源

如何从后面的 ASP.NET 代码访问 HTML 表单输入

如何在我自己的方法中模仿 string.Format()?

如何通过 Google 图表 API 使用 X 轴中的日期?

IIS 8.0 ASP.NET 和错误 500.19

如何进入 IIS 管理器?

将列表转换为 json 格式 - 快速简便的方法

在c#中显示带有换行符的标签文本

中继器中的中继器