问题
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