'Inspect environment variables of a process from Visual Studio
In Visual Studio, I want to inspect environment variables of a process launched from it, like in Process Hacker or Process Explorer. VS gives very advanced debugging capabilities, probably I'm missing something.
Background.
I've got a C++ program built by Visual Studio 2019.
It fails if launched from the Visual Studio IDE, but runs successfully if launched from a .cmd script. Cmd script sets additional environment variables, and I want to mimic this behavior with setting those variables from Project properties -> Debugging. I have done it before, and everything was working.
Now something has changed, and I'd like to figure out what.
Security policies of our company don't allow me to use Process Hacker and ProcessExplorer. If I try to launch any of these programs they are terminated by the corporate soft, installed on my PC.
Also, I'd like to avoid adding code that would retrieve these variables and print them.
So, in Visual Studio, is there something that can show environment variables for me?
Update The issue is indeed in environment vars. Specifically in the way, Visual Studio sets them. No crashes, if I set required variables globally from system control panel. However, something strange happens if I set them via project properties of Visual Studio.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
