3

When I right-click on a project and select Build, it builds it every time despite the fact that I just built it and the project is not out of date.

I've followed the instructions in the winning answer to a similar question, but that didn't resolve my problem.

I've also gone and made sure that Options/Project and Solutions/Build and Run settings were all correct. I turned on Detailed build output but didn't see anything obvious. The output is here: Part 1 and Part 2. The project itself if here.

The only thing that's suspicious is the following:

1>Project file contains ToolsVersion="4.0". This toolset may be unknown or missing

There is no ToolsVersion=4.0 in the project file.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • what's the .net framework your project was originally created for? which version of visual studio? – Francesco B. May 08 '18 at 19:23
  • Maybe I don't understand something, but in the log says: `Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.` | `Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped`. About references: `Did not copy from file "obj\$Reference" to file "bin\$Reference" because the "SkipUnchangedFiles" parameter was set to "true" in the project and the files sizes and timestamps match.` Your project wasn't rebuild. – UserName May 08 '18 at 19:34
  • @FrancescoB. Not sure. It's at least 15 years old. I am assuming .NET 2.0 – AngryHacker May 08 '18 at 20:25

1 Answers1

3

Answering my own question in case anyone runs into a similar problem. The problem was that some files in the project (binaries and other non c# files) were set to Content/Copy Always. I changed them to Content/Copy if Newer and that fixed the issue.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • 1
    I remember that I had the same problem a lomg time ago. When going through the build log, you should be able to trace this. Sometimes a tool helps too, to view the log in a structured manner, like msbuild log viewer http://msbuildlog.com). – Styxxy May 08 '18 at 20:31
  • 1
    @Styxxy The trick was to set the build log to `Diagnostic` instead of `Detailed`. Detailed mode didn't reveal any of the information I was looking for. – AngryHacker May 09 '18 at 03:56
  • Indeed! Now you say it, it rings a bell. Though, when troubleshooting I generally put the logs on diagnostics :-). – Styxxy May 09 '18 at 10:23