2014-08-28 13 views
5

Ich versuche, etwas wie ConsoleClassifier in .NET Compiler Platform ("Roslyn") Samples zu erstellen. (Microsoft.CodeAnalysis v0.7 ...) An diesem Punkt erhalte ich eine ReflectionTypeLoadException:Erstellen neuer Microsoft.CodeAnalysis.CustomWorkspace - get ReflectionTypeLoadException

CustomWorkspace workspace = new CustomWorkspace(); 

ReflectionTypeLoadException 
{"Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."} 
LoaderExceptions: FileNotFoundException 
{"Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. A rendszer nem találja a megadott fájlt.":"Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"} 

Was habe ich verpasst?

Stacktrace:

at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) 
    at System.Reflection.RuntimeModule.GetTypes() 
    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.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) 
    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) 
    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, IEnumerable`1& exports) 
    at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore[T,TMetadataView](String contractName) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports[T,TMetadataView](String contractName) 
    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports[T,TMetadataView]() 
    at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.<GetExports>b__6[TExtension,TMetadata](ExportKey _) 
    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue](ImmutableDictionary`2& location, TKey key, Func`2 valueFactory) 
    at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.GetExports[TExtension,TMetadata]() 
    at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.MefWorkspaceServices..ctor(MefHostServices host, Workspace workspace) 
    at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.CreateWorkspaceServices(Workspace workspace) 
    at Microsoft.CodeAnalysis.Workspace..ctor(HostServices host, String workspaceKind) 
    at Microsoft.CodeAnalysis.CustomWorkspace..ctor(HostServices host, String workspaceKind) 
    at Microsoft.CodeAnalysis.CustomWorkspace..ctor() 

Antwort

5

Sie benötigen den VS "14" Build Tools-Paket zu installieren. Sie finden es in der ISO here.

+0

Ich nehme nicht an, dass das Hinzufügen eines Verweises auf 'Microsoft.Net.ToolsetCompilers' es stattdessen tun würde? Ich würde es gerne in VS2013 ausprobieren können. (Oder ist das Build-Tool-Paket von VS selbst getrennt? Confused, von Tilehurst ...) –

+0

Nein, das Toolset-Paket ermöglicht Ihnen die Verwendung einer bestimmten Version der Roslyn-Compiler anstelle der vom System installierten. In diesem Fall verweist Roslyn jedoch auf MSBuild. Bald wird dies jedoch in einer anderen Assembly ausgeklammert werden und der Großteil der Workspace-Sachen wird ein PCL sein. –

+0

Großartig, danke - habe CTP4 für den Moment auf meiner Oberfläche installiert :) –

Verwandte Themen