Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a C# project without checking dependencies?

Given a Solution where:

  • Project P1 has a reference to P2
  • P2 has a reference to P3
  • P3 has reference to P4

When you call msbuild this way:

msbuild.exe /v:m "c:\mysolution\p1\p1.csproj"

msbuild checks all project dependencies is builds dependencies if necessary. The typical output is:

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

  P4 -> c:\mysolution\P4\bin\Debug\P4.dll
  p3 -> c:\mysolution\p3\bin\Debug\p3.dll
  p2 -> c:\mysolution\p2\bin\Debug\p2.dll
  p1 -> c:\mysolution\p1\bin\Debug\p1.dll

In my case, I know the dependencies exist and are all right.

Is there a way to build only project p1.csproj without verifying dependencies? The solution can be with msbuild or with something else.

like image 816
Sylvain Avatar asked Aug 27 '10 20:08

Sylvain


1 Answers

you can pass /p:BuildProjectReferences=false to msbuild, which will skip build project refence.. but this has one limitation, if your solution configuration and referenced project's configuration is mismatch, msbuild will failed to resolve referenced project's target output file...

here is a free vs extension package, you can download and try http://visualstudiogallery.msdn.microsoft.com/98de4058-8dc7-435b-9e01-c0f71dace808

vs package: Sharp Build Utility

I'm the author of this extension, i have the same requirement in current work, enjoy this tool...

essentially, this extension can handle above case, which will make a shadow copy of your build project file, change all project reference to dll file reference, and launch msbuild with the shadow project file.

like image 79
Winston Avatar answered Nov 04 '22 12:11

Winston