For an MVC 4 project, I have a requirement to include/bundle content files that reside outside the MVC project e.g. somewhere in a CDN.
This works:
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/Css/site.css"));
This does not work:
bundles.Add(newStyleBundle("~/Content/css").Include("D:/Media/Styles/Css/site.css"));
The error I get is:
The URL 'D:/Media/Styles/Css/site.css' is not valid. Only application relative URLs (~/url) are allowed. Parameter name: virtualPaths
In short, is it at all possible to have asset files residing outside the project's Content folder, for example when using a CDN? if so, what is the best approach?