Base solution for your next web application
Open Closed

BadImageFormatException when I target .NET Framework 4.7.2 #8806


User avatar
0
MASITEK_ASPNETZERO created

Hi there, I am trying to get the ASP.NET MVC 5.x & AngularJs 1.x (v8.4.0) to work with .NET framework 4.7.2. I'm using Visual Studio 2019 and when I change the target frameworks for all the projects in the solution to 4.7.2, the solution builds fine, but won't run.
The error I get is: [BadImageFormatException: Could not load file or assembly 'System.Data.Common' or one of its dependencies.

System.Data.Common is referenced (nuget). I reinstalled all packages using the package manager console. I've manually removed the reference and installed it again. If I remove it from the web.config, the error just changes to the next referenced package and so on.

Any suggestions?

VS 2019 (16.5.1) Win 10 (1909)


1 Answer(s)