Go Back

How can you find out why a project won't build in VS ?

I have a synergy.net project with around 12 projects in it.  Sometimes it fails to build for no reason at all.

The output window just says it failed to build.  It comes up with the same message if you try to clean it.

Nothing is actually wrong, but you can't find out what it thinks is wrong.

It eventually goes away through some combination of :
 - toggling debug and release
 - toggling x64 and any CPU
 - switching solutions
 - exiting VS
 - rebooting

Any info which helps me resolve this more quickly would be appreciated.


4 Answers
0   | Posted by Gordon Ireland to Visual Studio Integration on 10/30/2019 5:26 PM
Gordon Ireland
Here is all it tells you :

2>------ Build started: Project: Programs-C, Configuration: Debug x64 ------
2>Done building project "Programs-C.synproj" -- FAILED.
StopBuild: Build canceled because project Programs-C failed to build.
Build has been canceled.

10/31/2019 3:25 PM   0  
Ace Olszowka
We've seen this from time to time as well; the best advice we can give is:
  1. Close Visual Studio
  2. Delete all unversioned items (this usually punks out the .vs folder for us because it is not under source control)
  3. Rebuild.
Sometimes if you look in the /obj/ folder and look at the *.log file you get lucky.

I realize that these steps are pretty much identical to what you're doing today but the number of steps are shorter. It gets more painful the larger number of projects you have.

The closest I have ever gotten to it is I feel something is getting corrupted or is out of date but the build system does not think it is out of date. Deleting unversioned items is the largest hammer possible (we find it more reliable than "Rebuild").

10/31/2019 9:06 PM   0  
Mark Vinten
You should be able to update the build logging level to verbose to see every action that MSBuild is taking.  This should help you identify what step is actually bugging it out but it isn't not a level to set for an extended period of time as it'll just bombared you with lots of wasted/useless information and slows down build times.

11/1/2019 9:36 AM   0  
Ace Olszowka
To Echo Mark's comments you can set it up to verbose but as he mentioned it will eventually kill your box.

If you are really serious about tracing it down grab a copy of MSBuild Structured Log Viewer (http://msbuildlog.com/ [source here https://github.com/KirillOsenkov/MSBuildStructuredLog]) and set it up to run within Visual Studio. I'd pay attention specifically to the design time builds; follow this guide: https://github.com/dotnet/project-system/blob/master/docs/design-time-builds.md.

The problem is many of the tasks that Synergex originally wrote were not true MSBuild but were C# Tasks that were called via MSBuild; this means much of the determination of "Is Something Up To Date" or "Should I Build" are opaque to this (and other MSBuild) tooling.

11/1/2019 1:31 PM   0  
Please log in to comment or answer this question.