Exported contract type 'IModelBinder' is not assignable from part 'BookModelBinder'.

Mar 23, 2012 at 5:18 PM

I get this error when I run the MVC sample from latest source code.

Apr 11, 2012 at 4:13 PM

Thanks for letting us know about this. The issue is that a number of binding redirects are missing from Web.config that need to be there when MVC4 is used.

We'll update the repository shortly; for reference the needed lines are:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>     
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Apr 11, 2012 at 11:36 PM

I get the same error in MVC 3