6

How can I get MSBuild to completely ignore all the <ProjectReference> elements in my .csproj? I really want it to build just the current project, without the projects that it depends on.

Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166

1 Answers1

9
msbuild MySolution.sln /t:MyProjectName /p:BuildProjectReferences=false

The key is the BuildProjectReferences=false parameter.

jlew
  • 10,491
  • 1
  • 35
  • 58
  • It'd be nice if you edited the optional switches out to make the flag clearer. (Platform, Config, verbosity, maxcpucount) – Ritch Melton Jul 06 '11 at 13:59
  • 2
    Also: beware: don't be tempted to add `;build` to the `t:MyProjectName` - if you do this, the entire solution will be built regardless of the BuildProjectReferences option setting. – Jeremy McGee Sep 05 '11 at 11:25