I have an MVA project with OAuth authentication, every time I try to debug the project, I get a FileLoadException when setting IAppBuilder. I installed version 3.0.1 from Microsoft.Owin.Security.Oauth using PMC, but I think that somewhere else there is a link to an older version of the package, because ...
This is an exception:

Here it is thrown:
public partial class Startup { public void Configuration(IAppBuilder app) { ConfigureAuth(app);
This is my package.config:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Antlr" version="3.4.1.9004" targetFramework="net45" /> <package id="CommonServiceLocator" version="1.3" targetFramework="net45" /> <package id="EntityFramework" version="6.0.0" targetFramework="net45" /> <package id="jQuery" version="1.10.2" targetFramework="net45" /> <package id="jQuery.Validation" version="1.11.1" targetFramework="net45" /> <package id="log4net" version="2.0.3" targetFramework="net45" /> <package id="Microsoft.AspNet.Identity.Core" version="1.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Identity.EntityFramework" version="1.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Identity.Owin" version="1.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.HelpPage" version="5.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Owin" version="5.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" /> <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.0.0" targetFramework="net45" /> <package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> <package id="Modernizr" version="2.6.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Owin" version="1.0" targetFramework="net45" /> <package id="Unity" version="3.5.1404.0" targetFramework="net45" /> <package id="WebGrease" version="1.6.0" targetFramework="net45" /> </packages>
I tried to add call forwarding redirects as such:
<dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security.OAuth" PublicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-3.0.1.0" newVersion="3.0.1.0"/> </dependentAssembly>
I donβt understand why this does not work, does Visual Studio make a difference between 3.0.1 and 3.0.1.0?
I tried to delete the obj and bin folders, clean up the projects and restore them.
I tried to remove all nuget packages and restore them.
I tried reinstalling all Owin packages.
I used the Ransack agent to search my entire source directory for any file containing Microsoft.Owin.Security.OAuth, but could not find links to version 2.0.0.0 or any other version than the correct 3.0.1.0.
I'm stuck, any ideas?
source share