Reputation: 30757
I have the same issue found in these questions
Could not load file or assembly 'WebGrease' or one of its dependencies
None of the answers in these seem to help.
I have a WebForms project Running .Net 4; not MVC.
I am adding bundling & minification using Microsoft Web Optimization, along with its dependencies.
I am receiving the error:
Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have tried changing the version of web grease, and also web optimization. None are working.
These images show my current references, web config and other info:
I am trying to apply my bundle by using the code below, in my master page:
<asp:PlaceHolder runat="server">
<%: System.Web.Optimization.Scripts.Render("~/JS/Global") %>
<%: System.Web.Optimization.Styles.Render("~/CSS/Global") %>
</asp:PlaceHolder>
Anybody have any idea how I can get this working? I don't mind using an older version of the libraries; just can't seem to find one that isn't causing the issue.
Could it be the version of NewtonSoft.Json?
Update
So no matter what versions I install, I get the exact same message, right down to the version.. Can't seem to figure where the issue lays
Upvotes: 0
Views: 2041
Reputation: 33391
Why you redirect Newtonsoft.Json
version binding to version 7.0.0.0. There is no such version in your packages. Remove that redirection or add appropriate version of Newtonsoft.Json
.
Upvotes: 2