I'm trying to add bundling to my Mvc4 web project. The steps I took:
System.Web.Optimization
@Styles.Render("~/Content/css")
within <head>
of my _Layout.cshtml
BundleConfig.RegisterBundles(BundleTable.Bundles);
to Global.asax.cs
BundleConfig.cs
to my App_Start
folder with bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
within RegisterBundles(...)
methodsite.css
within my Content
folder.The error that I get on the line from step #2 above is Could not load file or assembly 'WebGrease, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Am I missing a DLL reference or something? Note that I started originally from a blank Mvc4 project.
Over the last day or so I was having this issue too but I figured out a solution. Basically you need to just update "webgrease".
Here's what I did to update webgrease:
This worked for me when I built my solution.