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.
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.
- Close Visual Studio
- Delete all unversioned items (this usually punks out the .vs folder for us because it is not under source control)
- Rebuild.
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").
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.