Search code examples
asp.netbundle

Asp.net 4.5 bundling Script.Render throws exception


After adding bundling to the project and going through a Microsoft tutorial on MSDN, I am started to get the following exception:

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.

On following line of code:

<%:System.Web.Optimization.Styles.Render("~/bundles/Styles") %>

I've tried to look for this reference, but in my solution there is no reference to this DLL. Anyone faced with something similar ?


Solution

  • The easiest way to solve this missing dependency would be to simply grab it using the NuGet package manager, e.g.

    install-package WebGrease
    

    ...or right clicking on your package, managing NuGet packages, and searching for it.