将 ASP.NET 5 从 Beta6 更新到 Beta7 后无法加载资源(CSS、JS 和图片文件)
Failed to load resource (CSS,JS and picture files) after updating ASP.NET 5 from Beta6 to Beta7
有一个关于 ASP.NET 5 Beta6 (MVC) 的工作项目,我想将它更新到 Beta7 版本。所以在这一步之后:
- 更新 Visual Studio 工具
- 更新 DNX 运行时(resource)
- 更新项目中的引用(在
project.json
和 global.json
文件中)
- 检查 ASP.NET Announcements Page 是否有更改(我只更改了命名空间)
- 更改错误的命名空间
我在 google chrome 控制台中收到了这样的消息,在 运行 之后我的所有内容文件:
Failed to load resource: the server responded with a status of 404 (Not Found)
解决方案是根据this announcement更新Startup.cs代码。
public void Configure(IApplicationBuilder app)
{
app.UseMvc(routes =>
{
routes.MapRoute(
name: "DefaultController",
template: "{controller=Home}/{action=Index}/{id?}"
);
});
app.RunIISPipeline(); //New
}
有一个关于 ASP.NET 5 Beta6 (MVC) 的工作项目,我想将它更新到 Beta7 版本。所以在这一步之后:
- 更新 Visual Studio 工具
- 更新 DNX 运行时(resource)
- 更新项目中的引用(在
project.json
和global.json
文件中) - 检查 ASP.NET Announcements Page 是否有更改(我只更改了命名空间)
- 更改错误的命名空间
我在 google chrome 控制台中收到了这样的消息,在 运行 之后我的所有内容文件:
Failed to load resource: the server responded with a status of 404 (Not Found)
解决方案是根据this announcement更新Startup.cs代码。
public void Configure(IApplicationBuilder app)
{
app.UseMvc(routes =>
{
routes.MapRoute(
name: "DefaultController",
template: "{controller=Home}/{action=Index}/{id?}"
);
});
app.RunIISPipeline(); //New
}