# Why doesn't this ContentLoader project (VS2010 e) recognize Microsoft.Build.dll?

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?

• I personally think that this should be moved to StackOverflow. Jan 28 '11 at 8:57

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".

• 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. Jan 28 '11 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:

<TargetFrameworkProfile></TargetFrameworkProfile>


is empty.

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