[英]404 Error with Durandal Starter Kit and Visual Studio
I have just installed the Durandal Starter Kit via Nuget and was hoping to start building Durandal apps using Visual Studio and the MVC framework. 我刚刚通过Nuget安装了Durandal入门套件 ,并希望开始使用Visual Studio和MVC框架构建Durandal应用程序。 I've read a couple of articles and blog posts like this but whenever I try and set up a sample Durandal application I get a 404 error with the browser complaining: '
The resource can't be found.
我读了几篇文章和博客帖子喜欢这样 ,但每当我试图建立一个示例应用程序迪朗达尔我得到一个404错误与浏览器抱怨:“
The resource can't be found.
' '
I've checked and the Nuget installation has set up DurandalController.cs
and deleted the default MVC controller. 我已经检查过,并且Nuget安装已经设置了
DurandalController.cs
并删除了默认的MVC控制器。 The project was created as an 'ASP.NET MVC 4 Web Application' using the 'Empty' template. 使用“空”模板将项目创建为“ ASP.NET MVC 4 Web应用程序”。 What am I doing wrong?
我究竟做错了什么?
The problem was that the installation of the Durandal Starter Kit had created a new default controller but hadn't set it as the default route for the project. 问题在于Durandal Starter Kit的安装创建了一个新的默认控制器,但没有将其设置为项目的默认路径。
To fix it, I navigated to App_Start/RouteConfig.cs
and in RegisterRoutes()
I changed the default routes.MapRoutefrom: 为了修复它,我导航到
App_Start/RouteConfig.cs
并在RegisterRoutes()
更改了默认路由。
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
to: 至:
defaults: new { controller = "Durandal", action = "Index", id = UrlParameter.Optional }
The application worked straight away after this change. 更改后,应用程序立即工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.