Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
I personally think that this should be moved to StackOverflow. –  DeadMG Jan 28 '11 at 8:57

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer
    
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. –  IAbstract 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.