Add-on components that enhance and customize the Visual Studio integrated development environment
Thank you for reaching out.
From my understanding, the recommendation is based on how Visual Studio and .NET are designed.
Visual Studio installs and manages its own copy of .NET, separate from the system-wide installation. Because of this, multiple dotnet.exe locations can exist on a machine.
However, the path of dotnet.exe inside the Visual Studio installation is not a documented or stable contract for extensions. It can vary depending on Visual Studio version, edition, or custom install path, and there is no supported API or environment variable that exposes this path.
Because of this, relying on the Visual Studio internal dotnet.exe or hardcoding that path is not considered reliable.
So instead, I suggest avoiding Visual Studio-specific paths and using a known trusted installation (like system-wide .NET) or a proper discovery mechanism. This aligns better with your requirement to use an absolute path while also avoiding CWE‑427 risks.
Please let us know if you require any further assistance, we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer". So that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.