5

I am converting a Asp.net Core 3.0 to asp.net core 3.1. Everything works fine from visual studio 2019. However when I publish a deployment package and execute the web application from IIS I get the following error message: Application startup exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (0x80131040) File name: 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Nuget package used: Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.Relational,Microsoft.EntityFrameworkCore.SqlServer,Microsoft.EntityFrameworkCore.Tools Packages Installed: Microsoft.Net Core.1.0 - Windows Server Hosting, Microsoft.Net Core - 3.1.0 Preview 3 (x64), Microsoft.Net Core SDK 3.1.100(x64) from visual studio

IIS: Version 6.1 (Build 7601 Service Pack1)

2
  • IIS Version is actually: Version 7.5.7600.16385 Commented Dec 8, 2019 at 22:59
  • Please check if the Microsoft.EntityFrameworkCore.SqlServer.dll file is existing under the folder of your published app/package. And you can try to republish your app and check if it can help fix the issue. Commented Dec 9, 2019 at 8:49

1 Answer 1

6

I just had the same problem, turns out I had to clean the output folder. /bin/Release contained netcoreapp3.0 and netcoreapp3.1 and somehow it got mixed up. I just cleaned the sources in Azure DevOps and tried again and it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.