1

After switching the all the projects to x86 architecture, I get the following error:

> dotnet ef migrations add Nullable-Fields --startup-project ..\LairageScanner.BlazorApp
Build started...
Build succeeded.
Could not load assembly 'LairageScanner.Context.SQL'. Ensure it is referenced by the startup project 'LairageScanner.BlazorApp'.

As seen above I have tried to run the command through CMD - but also done this for the package manager. I have seen some suggestion to fix this error: Stack Overflow & GitGub but neither of them had the solution to my issue.

Current Stack:

EF Core 3.1.3
Dotnet Core 3.1

Note: From the Git Solution it suggest converting to x64 and then just converting back later. And it does work. But I am looking for a more permanent solution.

Cornelis
  • 1,065
  • 8
  • 23

2 Answers2

0

I fixed it once with a simple action. You need to be sure that the Startup Project is the one with the startup.cs file. Also, be sure that all Project references are complete.

Well, it worked for me.

0

enter image description here

Select the layer where the dbcontext class exists

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 25 '22 at 17:00