I am using Visual Studio 2017 RC1
to load a CMake Project (C++) using the new "Open Folder" feature and try to set environment variables for the binary upon launching.
Since there is no solution file anymore when using Open Folder, the pre-VS-2017 way of using the debugging dialogue doesn't seem to be an option here.
What I've tried so far:
- Using a simple Hello World project with one single source file
- Right Click on the corresponding C++ file in the solution explorer, selecting "Debug and Launch Settings"
- Added
env: {}
there, which should give the Hello World program an empty environment
Screenshot of Solution Explorer and launch.vs.json
However, if I try to run the binary a pop-up window shows up which says "Object must implement IConvertible" and the binary won't run. It works fine when omitting env: {}
, though. I've also tried to add something to env, but the effect stays the same. Changing the working directory using currentDir works fine, so I assume that launch.vs.json
is at least read and used.
Since the documentation on this seems quite sparse, I am not sure if this is even the intended way for setting Environment Variables when using the VS 2017 CMake integration.