0

I'd like to invoke MSBuild to build a single project inside a solution. Therefore I use

MSBuild MySolution.sln /t:MyProject

Since I have some sophisticated deployment process and I want to save time, I need to build just the one project, but nothing else. Like mentioned here I tried

MSBuild MySolution.sln /t:MyProject /p:BuildProjectReferences=false

which works for project-to-project references, but not for project references defined by the solution (via ProjectSection(ProjectDependencies) in sln-file).

Does anyone know a way to ignore the solution project references also?

Community
  • 1
  • 1
peter-f-s
  • 11
  • 2
  • Build the project directly using msbuild /path/to/myproject /t:Build ? – stijn Jul 01 '16 at 11:17
  • Yes, but unfortunately I have some props files included (setting e.g. output directories) that use paths relative to the solution. If I build only the project (which is in a sub-folder), those paths are no longer correct... – peter-f-s Jul 01 '16 at 13:46
  • 1
    With 'relative to solution' you mean by making use of $(SolutionDir)? You can pass those to msbuild like /p:SolutionDir=/path/to/soltuion – stijn Jul 02 '16 at 08:00
  • Good point, that should work. For my special case I have some issues with this approach (like "The filename is too long"). So I'm still interested in an answer to my question - but if there is none I will go this way. Thank you! – peter-f-s Jul 04 '16 at 06:54
  • Can you clarify? What filename is too long? – stijn Jul 04 '16 at 07:09
  • It's a Universal Windows Platform project. The (default) build process creates a folder like "output/ProjectName/AppPackages/ProjectName_versionAndConfig/ProjectName_versionAndConfig.appx". My project's name is quite long, and this seems to be too much for MakeAppx.exe. – peter-f-s Jul 04 '16 at 07:21
  • Ok but how can there be a difference between building the solution or building a single project when both use the same paths? – stijn Jul 04 '16 at 07:31
  • Good question. I'll need to investigate... – peter-f-s Jul 04 '16 at 07:46

0 Answers0