I am working with an XNA content loader sample. In the references for the project (VS 2010 Express) there are:

  • Microsoft.Build
  • Microsoft.Build.Framework

    //as well as the standard XNA framework and graphics references

To emulate this project, I am trying to first add a reference to Microsoft.Build.dll. But Visual Studio warns me that it cannot load the .dll. I looked at MSDN and the document referenced Microsoft.Build.Evaluation. This is suppose to be available in the Microsoft.Build.dll and then I'll have access to the Project class.

Has anyone had any experience with this?

  • \$\begingroup\$ I personally think that this should be moved to StackOverflow. \$\endgroup\$
    – DeadMG
    Jan 28, 2011 at 8:57

2 Answers 2


Make sure to change the project's target .Net Framework from .Net 4 Client Profile to .Net 4. The client framework does not include MSBuild.

To do this open the project properties, select the Application tab, and change the Target Framework dropdown to ".Net Framework 4".

  • \$\begingroup\$ I finally figured this out about MSBuild. A very interesting library. My guess, and my hope, is that this gets set as a standard piece of the .Net library some time in a future release. \$\endgroup\$
    – IAbstract
    Jan 28, 2011 at 21:58

If for some reason you have the infamous .NET bug where the Target Framework box is greyed out and you are stuck in Client mode, you can force VS2010 to use the full framework by opening the .csproj file in a texteditor and then make sure that this line:


is empty.

Worked for me, now Microsoft.Build is available to reference in the project.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .