1
votes

I am getting the following error in my MVC project (running on .Net 4.6.1 framework);

Could not load type 'WebMarkupMin.Core.WebMarkupMinContext' from assembly 'WebMarkupMin.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=99472178d266584b'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'WebMarkupMin.Core.WebMarkupMinContext' from assembly 'WebMarkupMin.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=99472178d266584b'.

In my references I have version 2.4.0.0 referenced and in my packages .config I have;

   <package id="WebMarkupMin.Core" version="2.4.0" targetFramework="net461" />

In the web.config root I have;

  <dependentAssembly>
    <assemblyIdentity name="WebMarkupMin.Core" publicKeyToken="99472178d266584b" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
  </dependentAssembly>

I have tried uninstalling and then reinstalling through nuget, which has not worked.

Any ideas what is causing this?

1

1 Answers

0
votes

Not sure if this will still help anyone but I encountered the same issue, and solved it by simply following the following steps:

  1. Uninstall a WebMarkupMin.Mvc and WebMarkupMin.Web packages.
  2. Install a WebMarkupMin.AspNet4.Mvc package.

Upgrade a remaining old WebMarkupMin packages to version 2.X. In application code need to replace all usings of WebMarkupMin.Mvc.ActionFilters namespace to WebMarkupMin.AspNet4.Mvc.

which I found on this page