Could Not Load Assembly Ensure it Is Referenced by the Startup Project

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?

Did you select the correct project in the PMC project dropdown?

Yes. There is only one project to select It’s the same one as the one in the error message.