Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.



Programming and Learning from SD

File new project, MVC (Visual Studio 2013 in April 2014)

Update all NuGet packages and I get this:

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Owin.Security, Version=2.1.0.0, 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)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Owin.Security, Version=2.1.0.0, 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)
Source Error:

Line 16: { Line 17: // Configure the db context, user manager and signin manager to use a single instance per request Line 18: app.CreatePerOwinContext(ApplicationDbContext.Create); Line 19: app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); Line 20: app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

 
Microsoft.Owin.Security is 3.0.1 but the Microsoft.AspNet.Identity.Owin is 2.2.1 requires Microsoft.Owin.Security >= 2.1.0.
Guess what, my web.config redirect that was added was incorrect:
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />         
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />       
</dependentAssembly>

 

should be!

<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />         
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />       
</dependentAssembly>
Posted on Sunday, April 12, 2015 2:01 AM MVC | Back to top


Comments on this post: Updating New MVC Project NuGet packages could not load Microsoft.Owin.Security

# re: Updating New MVC Project NuGet packages could not load Microsoft.Owin.Security
Requesting Gravatar...
Great!
When I could not find a hind anywhere on net, found your solution!
Thanks a Ton!
Left by Wao! Great! on Mar 04, 2017 8:35 AM

Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net