Asp.net 如何调试抛出错误且不';是否在global.asax中未命中断点?

Asp.net 如何调试抛出错误且不';是否在global.asax中未命中断点?,asp.net,visual-studio,asp.net-mvc-3,Asp.net,Visual Studio,Asp.net Mvc 3,今晚,我刚刚花了些时间使用将现有的ASP.NET webform应用程序转换为MVC3。但是,当我启动应用程序只是在本地运行应用程序以检查我的工作时,我遇到以下错误: Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been

今晚,我刚刚花了些时间使用将现有的ASP.NET webform应用程序转换为MVC3。但是,当我启动应用程序只是在本地运行应用程序以检查我的工作时,我遇到以下错误:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is 
temporarily unavailable.  Please review the following URL and make sure
that it is spelled correctly. 

Requested URL: /

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET     Version:4.0.30319.237
我曾尝试在我的global.asax中设置各种断点,因为我怀疑我把路由搞砸了,但根本没有命中断点。因为它没有到达这个文件中的断点,所以我的假设是,我不需要同时查看控制器或视图,因为这是执行路径的下一步

“我的文件夹”结构包含以下文件夹和文件:

Controllers\
    HomeController.cs
Models\
Views\
    Home\
        Index.cshtml
    Shared\
        _Layout.cshtml
        Error.cshtml
    _ViewStart.html
    Global.asax
    web.config
web.config
以下是global.asax的内容:

使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用System.Web;
使用System.Web.Mvc;
使用System.Web.Routing;
名称空间www
{
公共类MVC应用程序:System.Web.HttpApplication
{
公共静态无效注册表全局过滤器(全局过滤器集合过滤器)
{
filters.Add(新HandleErrorAttribute());
}
公共静态无效注册表项(路由收集路由)
{
routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
//忽略aspx页面(web表单处理这些页面)
IgnoreRoute(“{resource}.aspx/{*pathInfo}”);
routes.MapRoute(
“默认值”,//路由名称
“{controller}/{action}”,//带参数的URL
//参数默认值
新建{controller=“Home”,action=“Index”}
);
}
受保护的无效应用程序\u Start()
{
RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
注册地址(RouteTable.Routes);
}
}
}
\控制器\HomeController.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace www.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

    }
}

我对ASP.NET MVC和Visual studio比较陌生,所以不确定从哪里开始调试。任何提示都将不胜感激。

根据Mystere Man的回复,答案是
global。asax
被错误地放在\Views\文件夹下,而不是根目录下。一旦我移动了它,一切都很好。

您说它是“global.asax”,但您的名称空间命名为“www”。如何???项目的名称是“www”。您确定bin位于正确的目录中吗?如果是这样,所有dll都部署了吗?Global.asax不应该在Views文件夹中,它应该在根目录中。@Mystere-Man:OMG,就是这样。多么愚蠢的错误啊。