0

i have a visual studio 2019 project that i need to build over and over again as it triggers a post-build script. but if I build the project once, and then try again, the second time my build will just say "up to date" and wont trigger any post built steps

Build started...
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

same thing happens if I trigger my build using command line msbuild

is there some way I can tell my VS2019 project to always build, regardless of if no files were changed since the last build? Thanks

POVR2
  • 87
  • 10

1 Answers1

0

I would suggest using rebuild which does a clean + build.

EDIT: If you only want to rebuild in order to execute your Post-build events, try modifying the "When to run the post-build event" to "Always" instead of "When the build succeeds". This should trigger your event even when no build happened because your files are up to date.

J Flex
  • 312
  • 1
  • 3
  • 11
  • my worry with changing my post build step to always run is that my post build step relies on NuGet package dependencies to be downloaded, so i realize that if my build fails and it still runs post build script it could cause unexpected problems.. – POVR2 Jun 03 '22 at 15:07
  • but rebuild could work – POVR2 Jun 03 '22 at 15:07