Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly Microsoft.Owin 3.0.0 to 3.0.1

Tags:

c#

.net

azure

Interesting dependency issue...

VS2015.3, .NET45 updating Microsoft.Owin from 3.0.0 to 3.0.1 (traced this update to be the problem - wanting to install https://www.nuget.org/packages/IdentityServer3.AccessTokenValidation/)

enter image description here it works locally on IIS Express

but publish to Azure website: (am removing additional files at destination on azure publish straight from VS). restarted and deleted all files from azure webserver too.

enter image description here

web.config translation looks okay

<dependentAssembly>
   <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
   <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />   
</dependentAssembly>

Edit Bruce Chen's answer pointed me in the direction of Kudu (Azure - Development Tools, Advanced Tools)

enter image description here

I downloaded the Owin dll, and it was the wrong version ie 3.0.0

To fix I cleared out all package artifacts from my solution

git clean -xfd (be careful)

Then rebuilt

like image 778
Dave Mateer Avatar asked Sep 01 '16 16:09

Dave Mateer


People also ask

Why can’t I find the Assembly with specific version that referenced?

In general, this means that the .NET Assembly loader could not find the assembly with specific version that was referenced. Please make sure this assembly with version 3.0.1.0 could be found in your Azure website and the version matches the definition in your web.config via KUDU or FTP client.

How do I update OWIN to the latest version?

If you are using Visual Studio right click the project --> Manage NuGet Packages --> Updates --> select the Owin nuget --> Click "Update". As of today, the latest version is 4.0.0.

How to update the OWIN NuGet?

If you are using Visual Studio right click the project --> Manage NuGet Packages --> Updates --> select the Owin nuget --> Click "Update". As of today, the latest version is 4.0.0. Hope it works out fine!


1 Answers

I wasted a couple of hours on this too because the reference installed by nuget had version 3.0.0 despite the nuget package being labelled 3.0.1

Making the old version newer than the new version fixed my problem:

      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>

*Edit: I think(but not certain) that the reason my version was still 3.0.0.0 was because the bin folder got caught in my repo and nuget didn't want to write over the dll

like image 60
vsmash Avatar answered Oct 20 '22 00:10

vsmash