Visual Studio によって生成されたデータベース ファーストの Entity Framework モデルとコンテキストがあり、テスト プロジェクトから直接参照しても問題ありません。
ただし、現在、コンテキストとリポジトリを MEF を介してエクスポートし、モジュールの 1 つにインポートしようとしています。ただし、アプリを実行すると、次のエラーが表示されます
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Resulting in: An exception occurred while trying to create an instance of type 'InsuranceManager.Data.Context.InsuranceDataContext'.
Resulting in: Cannot activate part 'InsuranceManager.Data.Context.InsuranceDataContext'.
Element: InsuranceManager.Data.Context.InsuranceDataContext --> InsuranceManager.Data.Context.InsuranceDataContext --> AssemblyCatalog (Assembly="InsuranceManager.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'InsuranceManager.Data.Context.InsuranceDataContext (ContractName="InsuranceManager.Data.Context.InsuranceDataContext")' from part 'InsuranceManager.Data.Context.InsuranceDataContext'.
Element: InsuranceManager.Data.Context.InsuranceDataContext (ContractName="InsuranceManager.Data.Context.InsuranceDataContext") --> InsuranceManager.Data.Context.InsuranceDataContext --> AssemblyCatalog (Assembly="InsuranceManager.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot set import 'InsuranceManager.Data.Repository.InsuranceRepository..ctor (Parameter="context", ContractName="InsuranceManager.Data.Context.InsuranceDataContext")' on part 'InsuranceManager.Data.Repository.InsuranceRepository'.
Element: InsuranceManager.Data.Repository.InsuranceRepository..ctor (Parameter="context", ContractName="InsuranceManager.Data.Context.InsuranceDataContext") --> InsuranceManager.Data.Repository.InsuranceRepository --> AssemblyCatalog (Assembly="InsuranceManager.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'InsuranceManager.Data.Repository.InsuranceRepository (ContractName="InsuranceManager.Data.Interface.IDataRepository")' from part 'InsuranceManager.Data.Repository.InsuranceRepository'.
Element: InsuranceManager.Data.Repository.InsuranceRepository (ContractName="InsuranceManager.Data.Interface.IDataRepository") --> InsuranceManager.Data.Repository.InsuranceRepository --> AssemblyCatalog (Assembly="InsuranceManager.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot set import 'InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel..ctor (Parameter="repository", ContractName="InsuranceManager.Data.Interface.IDataRepository")' on part 'InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel'.
Element: InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel..ctor (Parameter="repository", ContractName="InsuranceManager.Data.Interface.IDataRepository") --> InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel --> AssemblyCatalog (Assembly="InsuranceManager.GUI.MaintenanceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel (ContractName="InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel")' from part 'InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel'.
Element: InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel (ContractName="InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel") --> InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel --> AssemblyCatalog (Assembly="InsuranceManager.GUI.MaintenanceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot set import 'InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView.ViewModel (ContractName="InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel")' on part 'InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView'.
Element: InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView.ViewModel (ContractName="InsuranceManager.GUI.MaintenanceModule.ViewModel.GeoRegionMaintenanceViewModel") --> InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView --> AssemblyCatalog (Assembly="InsuranceManager.GUI.MaintenanceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView (ContractName="System.Object")' from part 'InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView'.
Element: InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView (ContractName="System.Object") --> InsuranceManager.GUI.MaintenanceModule.View.GeoRegionMaintenanceView --> AssemblyCatalog (Assembly="InsuranceManager.GUI.MaintenanceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
これが何を意味するのか、どこから始めればよいのか、誰か助けてもらえますか?