title: MSBuildWorkspace.OpenSolutionAsync throws an Exception
body: <p>Here is the complete code:</p>
  
  <pre><code>MSBuildWorkspace msBuild = MSBuildWorkspace.Create();
  Solution sln = await msBuild.OpenSolutionAsync(solutionPath);//NullReferenceException
  </code></pre>
  
  <p>where <code>solutionPath</code> is a valid <strong>.sln</strong> Visual Studio 2015 solution. I tried both a Winforms new project and a dll with a simple class. I closed that solution before attempting to read it, but that didn't help. It still throws the NullReferenceException.
  I'm using VS2015. x64 Windows 10.</p>
  
  <p>Is <code>MSBuildWorkspace</code> the wrong kind of <code>Workspace</code>? Is something else missing?</p>
  
  <p><sub>(NullReferenceException is actually a strange error to be thrown by a method. This is usually the type of error thrown by something like mistakenNull.DoSomething(); .)</sub></p>
  
  <p><strong>EDIT 2</strong> - This code is in a dll project in a solution which also contains a simple Winforms project which calls this code. (Since the Roslyn project template created a dll project.) Perhaps this matters.</p>
  
  <p><hr></p>
  
  <h2><strong>EDIT - Stack Trace</strong></h2>
  
  <p><strong>The exception</strong>: Object reference not set to an instance of an object.</p>
  
  <p><strong>Stack Trace</strong>: </p>
  
  <pre><code>   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.GetReferences(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject, IEnumerable`1&amp; metadataReferences, IEnumerable`1&amp; analyzerReferences)
     at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.CreateProjectFileInfo(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject)
     at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.&lt;GetProjectFileInfoAsync&gt;d__7.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
     at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.&lt;LoadProjectAsync&gt;d__40.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.&lt;GetOrLoadProjectAsync&gt;d__39.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.&lt;OpenSolutionAsync&gt;d__34.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
     at namespace1.RosTest.&lt;RenameMethods&gt;d__0.MoveNext() in C:\Users\...
  </code></pre>