我们的add-migrations经常会失败,但并不总是如此。迁移总是会到达脚手架步骤,然后大约5次中有4次我们会收到如下内容:
System.Runtime.Remoting.RemotingException: Object '/2355037d_df43_460b_8737_725c0c1c80be/hvdculybngjc_rcnskixmk7+_2.rem' has been disconnected or does not exist at the server.at EnvDTE.Project.get_Properties()
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T] (Project project, String propertyName)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.AddFile(Project project, String path, String contents)
at System.Data.Entity.Migrations.Utilities.MigrationWriter.Write(ScaffoldedMigration scaffoldedMigration, Boolean rescaffolding, Boolean force, String name)
at System.Data.Entity.Migrations.AddMigrationCommand.<>c__DisplayClass3.<.ctor>b__1()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Object '/2355037d_df43_460b_8737_725c0c1c80be/hvdculybngjc_rcnskixmk7+_2.rem' has been disconnected or does not exist at the server.
有时,无论如何都会生成迁移类,但更多的时候不会。对此错误的搜索表明,有些东西正在被垃圾收集,但这并不能真正帮助我们解决这个问题。
我们的数据迁移项目在Windows4.5中,EF 5在.NET 8、Visual Studio2012和SQL Server2012中工作。
https://stackoverflow.com/questions/18900204
复制相似问题