Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies

前端 未结 18 1721
夕颜
夕颜 2021-01-31 07:02

I have an MVC4 Web API project. While running the service project I am getting an error

Could not load file or assembly \'WebGrease, Version=1.5.1.25624,

18条回答
  •  醉梦人生
    2021-01-31 07:44

    In my case this was not solved by any of the solutions above. The error relating to webgrease was actually a red herring ... it was a problem with an invalid (and completely unrelated) assembly binding redirect. I guess this problem with my web.config file was causing all the assembly binding redirects to fail, and it just so happened this was causing a runtime issue with WebGrease.

    Basically, during a merge one of the binding redirects had got corrupted and it had ended up with two assembly redirects within a single tag.

    So, if you are getting this issue and you already have the binding redirect set up correctly for WebGrease, it is worth scanning through all your other assembly binding redirects to check that non of them have been corrupted.

提交回复
热议问题