我刚刚使用Razor引擎创建了一个新的ASP.NET MVC 3项目。我添加了一个控制器到控制器文件夹,然后在homController.cs
我添加了一个视图。使用Razor引擎的ASP.NET MVC 3中的'/'应用程序中的服务器错误
的视图(index.cshtml
)只有这个代码:
@{
ViewBag.Title = "Home";
}
<h2>Home</h2>
当我开始调试它表明我这个错误:
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.225
什么问题?
我想象你的路线错了 - 你的控制器的名字是什么? – glosrob
homController.cs是控制器的名称......当我调试它的路由是:'http:// localhost:13628 /',它不是工作! – user2478115
当我创建一个asp.net Web应用程序(没有MVC)并进行调试时,它完美地工作....我不知道错误为什么会出现! – user2478115