-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Version Used:
Visual Studio 2017 RC4
Microsoft.CodeAnalysis NuGet package 2.0.0-rc4
Steps to Reproduce:
- Create new WPF app (.NET 4.6.1)
- Add CodeAnalysis package from NuGet
- Add code (I did within an async Button Click event.
Project project = await Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create().OpenProjectAsync(@"C:\Projects\WpfApp4\WpfApp4\WpfApp4.csproj");- Run/debug code.
Expected Behavior:
Should be able to load a Project object.
Actual Behavior:
Get the following error.
System.Reflection.ReflectionTypeLoadException occurred
HResult=0x80131602
Message=Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source=mscorlib
StackTrace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Composition.Hosting.ContainerConfiguration.b__0(Assembly a)
at System.Linq.Enumerable.d__162.MoveNext() at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable1 types, AttributedModelProvider attributeContext)
at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create(IEnumerable`1 assemblies)
at Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices.get_DefaultServices()
at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create()
at WpfApp4.MainWindow.<Test_OnClick>d__2.MoveNext() in c:\Projects\WpfApp4\WpfApp4\MainWindow.xaml.cs:line 38