VCEnd is not a valid batch label for C# project Pre-/Post-Build event
Unlike Microsoft.CppCommon.Targets (VS 2019, line 132), which wraps incoming commands with :VCEnd, Microsoft.Common.CurrentVersion.targets (VS 2019, line 1325), which seems to be used for CSharp projects, does not add :VCEnd.
This leads to an unnecessary additional error message when generating these commands by using CMake as the VS generator adds jumps to VCEnd which does not exist for C# projects.
I think the generator should be fixed to either remove these jumps for C# projects or add the label itself somehow.
The attached sample project contains C# and C++ projects with failing prebuilt event. When generating for VS and executing the build the CSharp project will generate the following additional error message (caused by the VS generator)
The system cannot find the batch label specified - VCEnd
Files:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets