Could not load file or assembly ‘dotnet-aspnet-codegenerator-design’ :- MVC Core 2 issues.

In our recent MVC training in Mumbai one of our students was coding the whole lessons in MVC core 1 and later was trying to migrate the project to 2.0 and the below error came up. For migration we tried to follow these steps

“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.”


The solution for this was to remove entries of “Microsoft.VisualStudio.Web.CodeGeneration” from the “csproj” file. So we need to right click on the csproj and unload the project , edit and make changes.

By doing so your templates will not work. If you want to use templates you need to put the entries back to CSproj and remove it while running the application.



This entry was posted in ASP.NET MVC Training, Class Room Training, MVC, MVC Core Training and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *