dotnet / ef6

This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore.

Home Page:https://docs.microsoft.com/ef/ef6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add-migrations does not add Migrations folder

vsfeedback opened this issue · comments

This issue has been moved from a ticket on Developer Community.


I experienced today the same problem as described in https://developercommunity.visualstudio.com/t/migrations-not-add-in-folder-after-command-dotnet/934964.

I have a solution with multiple projects and DBContext. I deleted all old migration folders and started with a blank new DB. I created the migration for the first context with :

add-migration init -context AuthenticationDBContext

The migration folder shows up in the associated project. Then I create the second context:

add-migration init -context OrderDBContext

The migration is executed and the migration files is shown in VS, but the migration folder is missing in solution explorer. I can see the folder on the file system. In solution explorer I can't add a new folder with that name, because it already exists, but it is not shown. Show All files is selected.

The update-database command is not working, because the migration file is not found.

The .csproj file surprisingly has the following entry:

<ItemGroup>
  <Compile Remove="Migrations\**" />
  <EmbeddedResource Remove="Migrations\**" />
  <None Remove="Migrations\**" />
</ItemGroup>

After I have removed it the migrations folder showed up and the update-databse worked.

I know that the migration folder was excluded from github repo by a college, but I'm not aware that this entry was made in the project file.


Original Comments

Feedback Bot on 2/24/2022, 02:34 AM:

(private comment, text removed)

Feedback Bot on 2/24/2022, 10:01 AM:

(private comment, text removed)

Feedback Bot on 6/2/2022, 08:00 AM:

(private comment, text removed)


Original Solutions

(no solutions)

This issue has been closed because EF6 is no longer being actively developed. We are instead focusing on stability of the codebase, which means we will only make changes to address security issues. See the repo README for more information.