question

JohnEmmas-0498 avatar image
0 Votes"
JohnEmmas-0498 asked TianyuSun-MSFT commented

Rolling back a VS2019 update?

VS2019 updated itself this morning and I'm suddenly finding a problem with my C++ builds....

Normally, if I rebuild a project and then press 'Build' the build doesn't happen (because it's just been fully built). But what's happening now is that the pre-build and post-build stages keep getting run - even though the main project itself doesn't need to get compiled or linked.

Is there a way I can "roll back" a VS update and go back to the previous one which worked properly?

vs-setup
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Something just occurred to me.... quite a few of the VS2019 header files have been updated to today's date so that explains why my projects are getting rebuilt. But it doesn't explain why (after rebuilding) they're still considered as being out-of-date - UNLESS.....

What will happen if VS2019 itself is newer than my various .vcxproj files? Will that produce a situation where they're always deemed to be in need of rebuilding?

I might wait until tomorrow and give them all tomorrow's timestamp - and then see if that fixes the problem with my pre and post build steps.

0 Votes 0 ·
JohnEmmas-0498 avatar image
0 Votes"
JohnEmmas-0498 answered TianyuSun-MSFT commented

Tianyu - do you have any way to feed this back to the VS development team? AFAICT it happens with any build target which contains a PreBuildEvent - regardless of whether or not it contains a PostBuildEvent - e.g. inside the .vcxproj file:-

<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>
/--- Some instructions go here ---/
/--- (or it can even be empty ) ---/
</Command>
</PreBuildEvent>









· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi John, sure, it is possible to directly report the issue to Visual Studio Product Team on Developer Community(VS > Help > Send Feedback > Report a Problem…).

I have reported it, here is the link, you can follow up that thread, and add some necessary detailed information there.

0 Votes 0 ·
JohnEmmas-0498 avatar image
0 Votes"
JohnEmmas-0498 answered JohnEmmas-0498 edited

Hi - @TianyuSun-MFST I've found something which might be significant !!

Back in he early days of VS2019 I had some problems with debugging and I needed to set my Windows SDK Version to 8.1 ( <Any Project>->Properties->Configuration Properties->General )

If I build the project using one of the other settings, then I switch it back to 8.1 and rebuild, that seems to fix the problem. I've tried with 3 x small projects so far and it worked for all of them. I'm just trying a larger project and I'll report back.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes that does seem to fix the problem... in fact you don't even need to do the intermediate build. Just select Windows SDK Version and change it to one of the other options and click Apply. Then change it back to its original option and press Apply again. From then on, the builds all work as expected.

The only problem is that you need to do this for pretty near every project (i.e. any which have pre or post build commands). And I've got over a hundred of them here!!! So could someone please flag this up to the Visual Studio development team for me?Thanks!


0 Votes 0 ·

JohnEmmas-0498 wrote:
select Windows SDK Version and change it to one of the other options and click Apply. Then change it back to its original option and press Apply again. From then on, the builds all work as expected.

Groan... it's not quite that simple :-(

The above procedure does fix the problem - but only as long as that project & solution remain open. If you close the solution and then re-open it, the original issue immediately comes back again !!

I hope the VS development team can find the underlying cause because this problem is REALLY frustrating ...

0 Votes 0 ·
JohnEmmas-0498 avatar image
0 Votes"
JohnEmmas-0498 answered

Thanks... Setting the output to Detailed produces a lot of output but if I just set it to Normal here's what I see. Notice that quite early on, there's a line which says "Creating "F:+GTK-SOURCES\Mixbus32C\libs\temporal\MSVCtemporal\x64\Release \obj\temporal\temporal.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified."

So I'm guessing maybe there's an AlwaysCreate option which got toggled somehow as part of yesterday's Update process. Any idea how I can unset it?

John

Build started...
1>------ Build started: Project: temporal, Configuration: Release x64 ------
1>Build started 28/05/2021 11:12:58.
1>Target InitializeBuildStatus:
1> Creating "F:+GTK-SOURCES\Mixbus32C\libs\temporal\MSVCtemporal\x64\Release \obj\temporal\temporal.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
1>Target ClCompile:
1> All outputs are up-to-date.
1>Target ResourceCompile:
1> All outputs are up-to-date.
1>Target Link:
1> All outputs are up-to-date.
1> temporal.vcxproj -> F:+GTK-SOURCES\Mixbus32C\libs\temporal\MSVCtemporal\x64\Release\bin\libtemporal64RDC.dll
1>Target PostBuildEvent:
1> 1 file(s) copied.
1> 1 file(s) copied.
1>Target FinalizeBuildStatus:
1> Deleting file "F:+GTK-SOURCES\Mixbus32C\libs\temporal\MSVCtemporal\x64\Release\obj\temporal\temporal.tlog\unsuccessfulbuild".
1> Touching "F:+GTK-SOURCES\Mixbus32C\libs\temporal\MSVCtemporal\x64\Release\obj\temporal\temporal.tlog\temporal.lastbuildstate".
1>
1>Build succeeded.
1> 0 Warning(s)
1> 0 Error(s)
1>
1>Time Elapsed 00:00:00.12
========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped =========




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JohnEmmas-0498 avatar image
0 Votes"
JohnEmmas-0498 answered TianyuSun-MSFT commented

Thanks for helping with this Tianyu - just one thing I didn't quite understand...

@TianyuSun-MFST wrote:
" VS needs to add some dll files for the Build, and I think this is caused by updating VS(add new features and components/tools…)."

Are you saying that's what caused the problem? Or are you saying that running Update for a 2nd time might fix it?

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TianyuSun-MFST - I couldn't find an option saying Add new features and components here (VS 2019 Community Edition) so I tried Help->Check for Updates which told me I was already up to date - but crucially, it didn't fix the pre-build / post-build problems.

So I then tried Tools->Get Tools and Features but that gives me a lot of extra options. What would I need to choose to get those extra DLL's ??

0 Votes 0 ·

Hi @JohnEmmas-0498 , thanks for your feedback.

Are you saying that’s what caused the problem?

I just guess that may be the cause, as I see the detailed information in my output window, it mentioned “…. dll missing”. You can set the output verbosity option from Tools > Options > Projects and Solutions > Build And Run > MSBuild project build output verbosity, and choose Detailed, then reproduce your issue(rebuild > build) to see the detailed information in output window.

0 Votes 0 ·

What would I need to choose to get those extra DLL’s ??

Perhaps there are some misunderstanding, what I mean is like this (for example) “VS doesn’t check one rule and doesn’t need one dll in previous version when building, after you update VS, VS improved and supports to check the rule and this causes VS automatically start checking the unchanged and built project(when you build the project again after rebuilding/building it), and add the needed dll into the output file… ” and from what you see is like after clicking Rebuild, project rebuilds, and click Build, project doesn’t skip build, instead it rebuild/build again which also affects the pre-build and post-build.

You don’t need to add other dll files, as this depends on the specific environment and projects.

0 Votes 0 ·

I see that this issue still exists on your side, please try to set the “MSBuild project build output verbosity” option to Detailed and reproduce your issue, then check the detailed messages in the output window to see if the messages mentioned why starting rebuild/pre/post build.

0 Votes 0 ·
TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered TianyuSun-MSFT edited

Hello @JohnEmmas-0498 ,

Welcome to Microsoft Q&A forum.

Is there a way I can “roll back” a VS update and go back to the previous one which worked properly?

There is no way to “roll back” a VS update currently, but “roll back” feature is on roadmap, see this thread: Introduce the ability to roll back a Visual Studio Update.

Though it is not available to roll back, if necessary, you can uninstall the VS and install the previous version of VS from here: Release Dates and Build numbers. Note: only previous VS Enterprise and VS Professional edition supports to be downloaded, and for VS Community edition, only the latest edition is available.

What will happen if VS2019 itself is newer than my various .vcxproj files? Will that produce a situation where they’re always deemed to be in need of rebuilding?

I tested on my side, after updating VS, I opened a previous created and built C++ project which has pre-build event and built, I met the same issue that you met, VS started up-to-date check at beginning, and found a dll which was missing, but from the detailed output message, looks like VS needs to add some dll files for the Build, and I think this is caused by updating VS(add new features and components/tools…).

After that I tested again and this time it worked like before and Build(pre-build) wasn't triggered after Rebuild.

Feel free to let me know if you still meet this issue today.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.