Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild Silently Skipping One Project (out of many in my sln)

About to lose my mind with this one... A solution build when run via MSBuild is silently failing to build one of many projects in the solution.

The build doesn't fail, it simply never attempts to build it at all (ascertained via the log files MSBuild and devenv output). This is a VS2010 solution file. Let's call the problem project Project X. What I know:

  • I have a solution which contains ~30 projects.
  • All of these projects are set to build under Release|Win32. I have double and triple (and quadruple) checked this.
  • If I build the solution in VS every project builds correctly, including Project X.
  • If use the same exact command that MSBuild is using to launch devenv, Project X builds.
  • If I launch MSBuild passing it my project file, Project X is not built, not noted as skipped, just... not there at all (in the logs and output dir).

I have poured over the project file time and time again. All it really does is launch devenv like so:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Devenv.com" "MySolution.sln" /build "Release|Win32"

Again, if I use that exact same command in a prompt Project X is built. I have enabled diagnostic level logging in MSBuild to no avail. I'm at a loss at this point, any help will be greatly appreciated.

like image 638
Ed S. Avatar asked Dec 07 '12 00:12

Ed S.


2 Answers

This may be a shot in the dark - but I've had this issue before and have found that unloading the offending project and reloading it back into the solution does the trick. I have never determined why it happens, nor had anyone else explain it to me, but doing this has solved the issue two or three times for me on different solutions.

like image 114
Brian Knight Avatar answered Oct 23 '22 09:10

Brian Knight


I've removed ProjectSection(ProjectDependencies) = postProject from the Project which caused the problem in the sln file. This helped.

like image 40
gelin Avatar answered Oct 23 '22 08:10

gelin