2

I have an issue with the following error: "Could not load file or assembly". The error speaks for itself: Micorsoft.Owin version 2.0.0.0 fails to load in System.Web.Http.Owin. But I want to use Microsoft.Owin 3.0.0.0 and the dll of System.Web.Http.Owin I do reference has version 5.2.2.0 which on its own should work with Microsoft.Owin.

So my question here is who is referencing Micorsoft.Owin version 2.0.0.0?

And therefore: How can I find out which assembly is asking for Micorsoft.Owin 2.0.0.0?

Are there a recommended strategy for such issues?

What I tried to do so far is adding a binding redirect. But this would more be a workaround rather than a nice solution (and it did not work btw.):

 <dependentAssembly>
    <assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
Jester
  • 56,577
  • 4
  • 81
  • 125
Sjoerd222888
  • 3,228
  • 3
  • 31
  • 64
  • @Jester: I think it is not a duplicate. I do not ask how to enable assembly bind failure logging though using assembly bind failure logging would be an answer to my question. People how are looking for a strategy for this kind of problems do not yet know that 'assembly bind failure logging' does exist, so they will not search for this words... you see my points? – Sjoerd222888 Mar 31 '15 at 11:10
  • Yes they may search for this, and find the link to the other question which answers their question. See my point? ;) – Jester Mar 31 '15 at 11:11
  • Duplicates still show up in search, yes. You can try it :) – Jester Mar 31 '15 at 11:14
  • 1
    I just realized that others will still see the question. So thanks for linking! – Sjoerd222888 Mar 31 '15 at 11:15

1 Answers1

1

You can use the tool Fuslogvw.exe to get a log of assembly bindings, in particular what loaded what and where it looked for the assemblies.

It's installed with Visual Studio, but to run it you will need to open a Visual Studio command prompt (like this) and then run

fuslogvw
Joey Ciechanowicz
  • 3,345
  • 3
  • 24
  • 48