更新时间:2022-05-31 23:37:11
通常情况下,资源无法找到(这是一个HTTP 404)在ASP.NET MVC表明某种路由的问题。
Generally, the "resource cannot be found" (which is an HTTP 404) in ASP.NET MVC indicates some kind of routing problem.
在开始操作设置为一个页面(任何页面)可能是为什么你有这个问题。据我所知,这总是会产生404,因为MVC项目不做的网页,他们做的动作。
Setting the Start Action to a page (any page) is probably why you're having this problem. AFAIK, this will always cause a 404 because MVC projects don't do pages, they do Actions.
尝试清除开始行动 - 你再应该看到Index操作/视图页面拿出当您运行该项目。展望未来,如果你想要去一个特定的控制器操作在启动时,输入[ControllerName] / [动作]在开始行动没有一个.aspx页面名称。
Try clearing the Start Action- you should then see the Index action/view "page" come up when you run the project. Going forward, if you want to go to a particular Controller Action on startup, enter the [ControllerName]/[Action] in the Start Action without an .aspx page name.