Attempting to use migrations in a project other than starting a project results in an error

Hi, I am trying to use Entity Framework migrations, but when I add this command:

PM> Add-Migration

cmdlet Add-Migration in command pipeline position 1

Feed values ​​for the following parameters:

Name: CodeArtMigration

I am returning this error message:

Unable to determine a valid startup project. Use "CodeArt.DataAccess" instead. Your configuration file and working directory may not be installed as expected. Use the -StartUpProjectName parameter to set it explicitly. For more information, use the -Verbose switch. Packages not installed. The EntityFramework package is not installed in the "CodeArt.DataAccess" project.

The last part of the message saying that the Entity Framework is not available in the current project is incorrect because I have a link to the Entity Framework.

The package source is installed in Microsoft and .NET, but nevertheless, My code is structured in 3 layers. I wanted to add migration data to my DataAccess layer. I also wanted to minimize access to the Entity Framework only at my data access level.

+4
source share
1 answer

Make sure that your package manager console has the correct project selected in the drop-down list with the inscription "Default Project:" in the upper right corner of the "Package Manager Console" window in Visual Studio.

, Visual Studio 2015:
enter image description here

+7

All Articles