2

We have run into an issue where we have multiple solutions that use common projects will rebuild the project even though it was just built. FooProject and BarProject both have Service References (not sure if this is pertinent information). MobileProject and SecurityProject do not have service references. The issue that we are seeing is that if you open TestA.sln, change the configuration to Release a file build.force will appear in the obj/release folder.

TestA.sln and TestB.sln have the exact same 4 projects - FooProject, BarProject, MobileProject, and SecurityProject (for testing purposes obviously)

Here are the steps we take to reproduce the issue:

  1. Open TestA.sln in VS 2017
  2. Switch to Release configuration
  3. Build
  4. Close VS
  5. Wait a minute or 2
  6. Open TestB.sln in VS2017
  7. Switch to Release configuration (the force.build file appears in FooProject\bin\x86\Release and BarProject\bin\x86\Release)
  8. Build Close VS
  9. Open FooProject\bin\x86\Release. Notice how FooProject.dll and BarProject.dll were recompiled when you built TestB.sln

These repro steps are not valid in VS2015. This issue only occurs in VS2017.

If you delete the build.force file after switching to release but before building then the project won't rebuild. If you leave it the with Diagnostic build output enabled you will see a message like

Project 'FooProject' is not up to date. Last build was with unsaved files.

As far as I can tell the build.force file is a way to force a build by creating a file that was not included in the last build. Why is this happening only in VS2017? Why is it assuming that it needs to build at all?

Additional details:

I have a workaround to the above repro steps. If I open TestA.sln -> Release -> Build. Then Open TestB.sln -> close VS 2017 -> Open TestB.sln -> Release -> Build. Now the solution will properly not build any projects.

I don't believe that this has to do with circular references. I have cleared all references and re-added them without warning. The Build order seems to be fine as it builds in order of dependence (only 4 projects, pretty easy to see).

2
  • Something is rotten in the state of denmark, that "not up to date" message is quite unhealthy. Indicates a build order problem, a circular dependency between projects is easy to create by accident. Using Build > Clean might leave it permanently unbuildable. So that's what you want to do first. Oct 18, 2018 at 16:49
  • I don't believe that this has to do with circular dependency. I have cleared all references and re-added them without warning. The Build order seems to be fine as it builds in order of dependence (only 4 projects, pretty easy to see). Oct 18, 2018 at 18:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.