When trying to use Bundles in an MVC5 application. CSS files do not load, when I check the source code, I see the following link in HTML:
<link href="/Content/css" rel="stylesheet"/>
Why is this not working as I expect? I tried using different virtual paths but this does not work.
File My BundleConfig.cs:
using System.Web;
using System.Web.Optimization;
namespace Navi
{
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
Then in my _Layout.cshtml I have the following:
@Styles.Render("~/Content/css")
source
share