the question is over 3 years old, but I think it's still relevant now and again. Firstly, MSBuild is very version-dependent. So you always have to pay attention to which MSBuild version you are using. I noticed that although Microsoft still lists and describes the Microsoft.Build.Construction namespace in the description, the SolutionFile class no longer exists. I referenced MSBuild V4.0.0.0 in Visual Studio 2017. That's probably the problem here too.