0

我正在使用简单数据 (1.0.0-rc0)Simple.DataDatabase.Default.Licenses.All().ToList<License>()来获取许可证列表。它在我的生产环境(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。过去两天我一直在这样做,但没有任何进展。在服务器设置过程中我是否错过了一些重要的东西?

4

1 回答 1

2

这是 MEF 的问题。bin 文件夹中的一个程序集引用了 Microsoft.VisualStudio.Shell,当 MEF 尝试执行它的操作并且它无法遵循所有引用时,它会引发该错误。

这一直是最近几个错误报告的原因,下一个版本将对 MEF 代码进行更改,这将阻止它发生。

同时,作为一种解决方法,您可以使用引用跟踪程序集并将其删除,或者将该程序集放在 bin 文件夹中。我推荐前者,因为添加该程序集可能是整个添加越来越多链的开始。

于 2012-08-09T13:50:26.737 回答