Bundling fails because path mistaken for a controller path

↘锁芯ラ 提交于 2019-12-11 02:46:33

问题


In my BundleConfig I have

bundles.Add(new StyleBundle("~/Content/css/css").Include("~/Content/css/wireframe.css?v=1.0"));

In my view I have

@Styles.Render("~/Content/css/css")

But when I access the page concerned I get a 404 with this error

[HttpException]: The controller for path '/Content/css/css' was not found or does not implement IController.

It seems the path is being confused for a controller. Do I change my WebApiConfig and RouteConfig files?


回答1:


Schoolboy error. I was missing this in the Global.asax

BundleConfig.RegisterBundles(BundleTable.Bundles);


来源:https://stackoverflow.com/questions/20195254/bundling-fails-because-path-mistaken-for-a-controller-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!