This project is read-only.

MSBuildWorkSpace cannot open solution files

Topics: APIs
Jan 13, 2015 at 10:59 PM
I am new to Workspace API in Roslyn and come up with a simple project using MSBuildWorkspace class. However, I always get an error for not be able to find the specified file. I have double checked the filepath and it's correct.
string solutionPath = @"C:\Users\ECE\Documents\ConsoleApplication1.sln";
var msWorkspace = MSBuildWorkspace.Create();
var solution = msWorkspace.OpenSolutionAsync(solutionPath).Result;
When I debug, it always stops after executing the solution variable and give a warning "Aggregateexception was unhandled" with some exception for not finding the specified file. What am I missing? Any help would be appreciated!