-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Enable setting the VS dev environment without running from Dev Command Prompt #13571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should just silently cancel instead of showing an error.
I think an error might be okay if it was an actual error occurrence (and without it the user may not know it failed) but not a user cancellation though (via not selecting an option in the dropdowns).
We don't share an error popup in other cancellation cases.
Same as when the user hits the "Cancel" button:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If VS Code is already launched from a particular VS developer command prompt, then the Set VS Developer Environment command is still available and runnable, but confusingly has no effect with no warning that it's not actually used, i.e. it just uses the original environment. Can that be fixed somehow or give a warning? Or is it supposed to work and switch to the newly selected developer environment?
I would expect it to override the inherited environment. Does it not work for you? It worked for me. |
This comment was marked as resolved.
This comment was marked as resolved.
I have a fix for the "run from the developer command prompt" scenario in the node module. I just need to wait for it to show up in CFS so I can consume it. |
The latest push should address the remaining issues. |
Are you talking about when you upgrade VS and get a new toolset version for cl.exe? We can probably check for that. |
Yes upgrade or uninstall, e.g. uninstall Preview but you have non-Preview still then ideally the Apply option would appear for the non-Preview that is still installed. |
This change removes the requirement of running VS Code from a Developer Command Prompt in order to build with the Visual Studio C++ compiler on Windows.
Two commands are added:
Set Visual Studio Developer Environment
- Starts the process of picking the MSVC toolset that will be used to compile. This environment will be added to any new terminals launched from this session of VS Code. It will also be automatically applied for the Build and Debug feature. Note that the environment changes only apply to the current workspace. The command will need to be run on every workspace that needs the environment.Clear Visual Studio Developer Environment
- Removes the MSVC toolset environment.One setting is added:
C_Cpp.persistDevEnvironment
- This controls whether the developer environment is automatically applied the next time the workspace is opened.Walkthrough updates
The walkthrough is updated with a button to run the command and the instructions include the command as an alternative option to running VS Code from the Developer Command Prompt:

Play button updates
The Play button for Build and Debug Active File incorporates this command in the workflow if the developer environment is not detected. This should make the experience seamless going forward.

Terminal updates
When the command is run, any existing terminals will show a message prompting you to relaunch them so that the environment will apply to them.

Telemetry
Telemetry is added to track where the command was invoked.