Website cannot load Microsoft.EntityFrameworkCore
See original GitHub issueI have an API-only site (no pages) that is terminating as soon as it starts.
I found the following errors in Event Viewer.
Application: w3wp.exe
CoreCLR Version: 6.0.21.52210
.NET Version: 6.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.EntityFrameworkCore, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Program.<Main>$(String[] args)
And…
Application '/LM/W3SVC/18/ROOT' with physical root 'C:\inetpub\wwwroot\tt.railtrax.com\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.EntityFrameworkCore, Version=6.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Program.<Main>$(String[] args)
When I look at Microsoft.EntityFrameworkCore.dll in my deploy folder, it appears to be version 6.0.21.
Package Manager says I have 6.0.1 installed. So I don’t know why I have 6.0.21, or if it should work with that version.
The project runs fine on my own computer. I very recently upgraded all the suggested packages in Package Manager. I assume it happened as a result of that. Do these version discrepancies matter? What else I could try to resolve this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
dll - Could not load file or assembly 'Microsoft. ...
I have deleted local Nuget repository and now I get this error: Could not find a part of the path 'C:\Users\Admin\. · Try...
Read more >Could not load file or assembly class library " ...
When I run the application, I receive the error: Could not load file or assembly class library "Microsoft.EntityFrameworkCore version = 6.0 ...
Read more >'EntityFramework.Core.Tools' nuget package installation error
Tools' nuget package installation error: "The process cannot access the file ef.exe because it is being used by another process".
Read more >Getting error while scaffolding - Microsoft Q&A
EntityFrameworkCore.Tools. Uninstall-Package Microsoft.EntityFrameworkCore.Tools and Reinstall the package. PM> Install-Package Microsoft.
Read more >Installing Entity Framework Core - EF Core
From the Visual Studio menu, select Project > Manage NuGet Packages · Click on the Browse or the Updates tab · To install...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@GoodBoyAlex Were you able to resolve your issue? I just figured it out here. I just deleted the bin and obj folders for all projects involved and rebuilt everything. Now it works.
@SoftCircuits this looks like some sort of deployment issue. There’s very little info on how your website is hosted or how you’re deploying your application to the production server, but the exception says that the Entity Framework Core assembly (DLL) is missing. There’s not much we can do to help with that, but if you manage to reproduce the problem with a code sample, we can investigate further.