Base solution for your next web application
Open Closed

BadImageFormatException when migrating from ASP.Net Core 1.1 #3836


User avatar
0
alaamh created

Before the upgrade, I was able to Build to platform target x64, After migrated an ASP.Net Core 1.1 application to the new 2.0 version that was just released. Now I get the following exception:

for:

services.AddMvc(options =>
 {
       options.Filters.Add(new CorsAuthorizationFilterFactory(DefaultCorsPolicyName));
});

I'm getting this error:

System.BadImageFormatException: 'Could not load file or assembly 'dotnet-aspnet-codegenerator-design' or one of its dependencies. An attempt was made to load a program with an incorrect format.'

Any advice?


2 Answer(s)
  • User Avatar
    0
    alaamh created

    I did a workaround by removing the package reference Microsoft.VisualStudio.Web.CodeGeneration.Design (to disable scaffolding)

    • test it again not working :(
  • User Avatar
    0
    alper created
    Support Team

    can you check this answer if that solves your problem <a class="postlink" href="https://stackoverflow.com/questions/45801045/badimageformatexception-when-migrating-from-asp-net-core-1-1-to-2-0">https://stackoverflow.com/questions/458 ... 1-1-to-2-0</a>