update-database
他のマシンで実行される Entity Framework 5 プロジェクトで実行しようとしています。
コードをダウンロードし、プロジェクトを再構築しました。実行するupdate-database
と、次のようなエラーが発生します。
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindType[TBase](String typeName, Func`2 filter, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName)
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindConfiguration()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.GetMigrator()
at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
このエラーは、私の環境に一部のアセンブリが見つからないか、GAC で互換性のないアセンブリが見つかったために発生していると思います。しかし、どのタイプがロードに失敗したかを知らずに、私は暗闇の中にいるので、デバッグするのは非常に難しい問題です.
読み込みに失敗した型またはアセンブリを確認するにはどうすればよいですか? メッセージには「詳細については LoaderExceptions プロパティを取得してください」と書かれていますが、移行が自分のコードではなくパッケージ マネージャー コンソールで実行されている場合、どうすればそれを実行できますか?
コンソールに入力$Error[0].Exception
すると例外メッセージが表示されますが、他のプロパティを一覧表示するにはどうすればよいですか?