2012-08-09 35 views
0

我使用簡單數據(1.0.0-rc0)(如Simple.DataDatabase.Default.Licenses.All().ToList<License>())來獲取許可證列表。它工作正常,並在我的製作環境(VS2010,IIS7.5),但是一旦部署到服務器住它拋出:SimpleData中的System.IO.FileNotFoundException

`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.I已經在這個已持續在過去兩天沒有任何進展。在服務器安裝過程中,我是否錯過了一些至關重要的事情?

回答

2

這是MEF的問題。 bin文件夾中的其中一個程序集具有對Microsoft.VisualStudio.Shell的引用,當MEF嘗試執行它的操作並且無法關注所有引用時,它會引發該錯誤。

這是最近發生的幾個錯誤報告的原因,下一個版本將對MEF代碼進行更改,以防止它發生。

作爲解決方法,您可以使用引用跟蹤程序集並將其刪除,或將該程序集放入bin文件夾中。我建議前者,因爲添加該程序集可能是整個添加越來越多鏈的開始。

+0

我設法追查Visualstudio.Shell的2.0.0.0版本,並將它添加到項目中,因爲這看起來像是最快的臨時解決方案。非常感謝您爲我澄清這個問題,謝謝! – Rotkiv 2012-08-10 10:42:38

+1

此問題已在Simple.Data 0.17.1.1中解決,該問題昨天發佈給NuGet。不過,它尚未發佈在-pre分支中。 – 2012-08-28 11:15:12

相關問題