This project has moved and is read-only. For the latest updates, please go here.

OwinHost.exe and adding binding redirects

Sep 2, 2013 at 6:54 AM
I'm using OwinHost.2.0.1-rtw1-20831-600-dev.

When I invoke the OwinHost.exe under the right path, I'm getting the following exception (which makes sense):
Could not load file or assembly 'System.Web.Http, Version=, 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)
I'm getting the same exception under IISExpress but when I add the following binding redirects to web.config under IISExpress, my problem is solved:
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
Under my class library (which OwinHost.exe is working on), I added the same binding redirects inside the App.config file and copied this under bin folder. It didn't work. Then, I added the binding redirects inside the OwinHost.exe.config. That didn't work either.

What is the right solution for this problem with OwinHost.exe?
Sep 2, 2013 at 3:56 PM
OwinHost.exe follows the Web Application project template conventions. You need a file called Web.Config in your bin directory for these settings.
Sep 6, 2013 at 8:39 AM
Hi Chris,

Thanks a lot for the response. Will try that.