Umbraco 13
.Net8
Visual Studio 22
I am trying to scaffold an existing database in my new Umbraco 13 build. But, every time I run the scaffold command, after the project successfully builds, I get the error “Could not load assembly ‘x’. Ensure it is referenced in the startup project ‘x’.”
I am using PMC. I have installed Microsoft.EntityFrameworkCore.Design 9.0.2, Microsoft.EntityFrameworkCore.SqlServer, and Microsoft.CodeAnalysis.Common 4.10.0 (it required me to do so as Umbraco references an older version and the entity framework requires a higher version).
My PMC command is:
Scaffold-DbContext name=WebSubscriptionsEntities Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models/Subscriptions -Context Subscriptions_Context -Force
I know that this command works as I have used it in other projects successfully. I have tried replacing the named connection string with actual connection string, same result.
I ran into this problem before but I can’t remember what I did to get past it. Anyone got any ideas?