Could not load information for project X after update codegeneration 6.0.9

Viewed 506

I'm developing a .NET Core project. Yesterday, Web.CodeGeneration was updated automatically. After the update, I get an error when I try to add new view to my project:

"Scaffolding Failed"
"Could not load information for project X"

I tried to remove and re-install all nuget packages again, and I checked package versions and all of them are 6.0.9 so, same version.

I tried to create a new project to test "add view", but when I install Entity Framework Core packages with web.codegeneration in the test, project, I again get the same error.

How to fix it?

4 Answers

Unload all your class libraries/other projects except for your web application then try re-adding any scaffolded items. This is the current workaround that works on my end, at least until this bug gets fixed.

The issue has been reported and is a bug in the scaffolding code.

The suggested workaround is to scaffold in a new solution/project with the same name(s) and then copy the files over:

Make new project with same solution and project name and add DB context and other necessary thing than scaffold then the new added files add in the main project you are making, now you are good to go.

Unloading the linked projects as suggested by others works, provided you don't have your models in separate class projects.

Otherwise we will have to wait

If you create references to other projects, the error returns. Importing the libraries works, but if you reference them it gives an error

This isn't actually an answer, but I'm too new to leave a comment. I just wanted to pass along some information that I found useful. I was having an issue scaffolding my MVC Controller, with views, when my Library was unloaded, even though I kept the reference. This bug is also being discussed on GitHub, and Deepak Joy Jose uploaded this video showing the workaround: Scaffolding Workaround It's for identity scaffolding issues, but the same logic applies to controllers. It's a long workaround, but it did work for my issue.

Related