Could not load file or assembly Microsoft.Owin, Version=

Ben Wilson 0 Reputation points

I read similar posts at this forum but my situation is unique.

The error suddenly appeared after a successful deployment to Azure web app. The .Net framework is 4.7.2. There was no code change. The local run has no issue. Previous deployments were successful. I cloned the project from Git to another location, re-deployed it, but got the same error.

Here are what strange (or unique) about my situation.

  1. I found not find anything in my project referencing the MS Owin version 3.0.1. At either web.config or the csproj file, only version is referenced.
  2. I tried upload MS Owin 3.0.1 dll to the app via sftp, then I got the error - could not load file or assembly Microsoft.Owin, Version=

The root cause might be that both MS Owin and were somehow referenced by my project. Is this possible?

Thank you and regards,

A set of technologies in the .NET Framework for building web applications and XML web services.
3,237 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,787 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ben Wilson 0 Reputation points


    Thanks for the reply. By "MSBuild bin" log, you mean the "Build" output of Visual Studio 2022, right? I reviewed it but did not see any new info. I checked the directory obj\Release\Package\PackageTmp and the file "Microsoft.Owin.dll" had the correct version.

    To elimiate other factors, I updated the project to dotnet framework 4.8 and Microsoft.Owin to 4.2.2 (latest version). Below is the assembly redirect in web.config.

        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="" newVersion=""/>

    Then I got the error "Could not load file or assembly 'Microsoft.Owin, Version=" after the deployment.

    Any suggestions?