Search code examples
c#asp.net-mvcentity-frameworkazureweb-publishing

Azure site assembly dependency error - Works locally


I have an MVC website which runs perfectly locally but when I publish to Azure I get the error:

Could not load file or assembly 'EntityFramework.SqlServer' or one of its dependencies. The module was expected to contain an assembly manifest.

once I navigate to the log in page of the site.

Since the last successful publish I have updated a few NuGet packages, so I think maybe the version of EntityFramework.SqlServer.dll is wrong on the server, but surely it should have been updated during the publish?

I've included assembly binding for the dll:

  <dependentAssembly>
        <assemblyIdentity name="EntityFramework.SqlServer" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
  </dependentAssembly>

How would I check the version of the dll that is present on the server?

JK


Solution

  • I solved it by FTP'ing into the site and removing the dll, then I removed and readded the dll to my project and republished. I had to do the same for EntityFramework.dll as well.