Miral
Miral

Reputation: 6038

Could not load file or assembly 'System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I am getting the below error any idea?? I get this error message only when the controller call ValidateForm() method.

Could not load file or assembly 'System.Web.Abstractions, Version=0.0.0.0, 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)

Upvotes: 3

Views: 4914

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039298

The correct version of the assembly is 3.5.0.0. I guess you are using something compiled against a custom build version of this assembly. You could use a bindingRedirect to instruct the CLR to load the correct version of the assembly.

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="System.Web.Abstractions"
                              publicKeyToken="31bf3856ad364e35"
                              culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0"
                             newVersion="3.5.0.0"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

Upvotes: 7

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239764

That version number looks suspect, since the only proper version I can find on my machine is version 3.5. Might your code have been compiled against a CTP/Beta/Preview version?

Upvotes: 0

Related Questions