0
votes
  1. I have two projects in my solution, project1 and project2.
  2. Project2 tends to self host with Owin.
  3. I have enable CORS using Microsoft.Owin.Cors package.
  4. Both project have Microsoft.OWIN 3.0.1 and Microsoft.AspNet.Cors 5.2.3.
  5. Then, I copy my project2.exe to project1's debug folder and call prorject2.exe from project1.
  6. Then, then the exception box rises when trying to call project2.exe.

  7. The message is that it requires System.Web.Cors version 5.0.0.0 assembly.

  8. When I downgrade the Microsoft.AspNet.Cors to 5.0.0.0, it again says it requires Microsoft.Owin version 2.0.2.

Why does this occur and how do I fix this version conflict? Both the projects is built under .Net Framewrok 4.5.2.

1

1 Answers

0
votes

In order to resolve to conflict you must tell your code which version of OWIN to use. this can be done from your application's app.config.

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>