0

Simple.DataDatabase.Default.Licenses.All().ToList<License>()ライセンスのリストを取得するためにSimple Data (1.0.0-rc0) を使用しています。私のプロダクション環境(VS2010、IIS7.5)では問題なく動作しますが、ライブサーバーにデプロイされると、次のようにスローされます:

   `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.Assembly.GetTypes()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable1& exports)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore[T](String contractName)
   at Simple.Data.MefHelper.Compose[T](String contractName)
   at Simple.Data.AdapterFactory.DoCreate(String adapterName, IEnumerable1 settings)
   at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
   at Simple.Data.CachingAdapterFactory.Create(String adapterName, IEnumerable1 settings)
   at Simple.Data.DatabaseOpener.OpenDefaultMethod()
   at Simple.Data.DatabaseOpener.OpenDefault()`

`System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'`

サーバーは、新しくインストールされた Windows Server 2008 R2 を実行しています。この 2 日間、まったく進歩がありませんでした。サーバーのセットアップ中に何か重要なことを見逃したのでしょうか?

4

1 に答える 1

2

これは MEF の問題です。bin フォルダー内のアセンブリの 1 つに Microsoft.VisualStudio.Shell への参照があり、MEF がその処理を実行しようとして、すべての参照に従うことができない場合、そのエラーがスローされます。

これは、最近いくつかのバグ レポートの原因となっており、次のリリースでは、MEF コードが変更され、この問題が発生しなくなります。

当面の回避策として、参照を含むアセンブリを追跡して削除するか、そのアセンブリを bin フォルダーに入れることができます。そのアセンブリを追加すると、ますます追加するチェーン全体の開始になる可能性があるため、前者をお勧めします。

于 2012-08-09T13:50:26.737 に答える