Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Migration enhancements

$
0
0

Thanks for the info, I thought it was only for tests, it now installs.

Found some small issue below (nothing that I can't work around for now):

However when running Enable-Migrations for the second context in the same project I got the following error:

PM> Enable-Migrations -ContextTypeName EFMigration.DealerContext -MigrationsDirectory Migrations\DealersSystem.InvalidCastException: Unable to cast transparent proxy to type 'EnvDTE.Project'.   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.<AddFile>b__4(ProjectItems pi, String dir)   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.AddFile(Project project, String path)   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.AddFile(Project project, String path, String contents)   at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0()   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)

Unable to cast transparent proxy to type 'EnvDTE.Project'.

------------------

Running the same command without a "Migration" directory works. After running it second time:

PM> Enable-Migrations -ContextTypeName EFMigration.DealerContext -MigrationsDirectory Migrations\Dealers

Migrations have already been enabled in project 'EFMigration'. To overwrite the existing migrations configuration, use the -Force parameter.

-------------------

The first context was created using:

PM> Enable-Migrations -ContextTypeName EFMigration.CarContext -MigrationsDirectory Migrations\Cars

Checking if the context targets an existing database...

Code First Migrations enabled for project EFMigration.


Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>