I am using link.exe from Microsoft C++ toolset in the pre-build event in a c# project in Visual Studio 2019.
The problem is every time the Visual Studio 2019 updates, it changes the path because of the version of MSVC folder.
For example: In VS 16.2.0 the path to link.exe changes from ..\14.21.27702... to ..\14.22.27905..
I search for an environment variable but I couldn't find it.
My full command line:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\Hostx86\x86\link.exe" /MACHINE:x86 /VERBOSE /NOENTRY /DLL /OUT:"$(ProjectDir)$(OutDir)$(TargetName).ribbon.dll" "$(ProjectDir)RibbonMarkup.res")
I would like to be able to reference link.exe without this error-prone path.
Is there a way to get the path to link.exe without hardcoded it in my pre-build event?