简体   繁体   English

在 Visual Studio Code 中使用 Visual Studio C++ 项目

[英]Working with Visual Studio C++ project in Visual Studio Code

I have a C++ project in Visual Studio and I much prefer Visual Studio Code for editing source files.我在 Visual Studio 中有一个 C++ 项目,我更喜欢 Visual Studio Code 来编辑源文件。

Is there a way to work with Visual Studio C++ projects in Visual Studio Code?有没有办法在 Visual Studio Code 中使用 Visual Studio C++ 项目? Like getting include paths from ".sln" file or maybe even running MSBuild.就像从“.sln”文件中获取包含路径,甚至可能运行 MSBuild。

  1. Open Developer Command Prompt/PowerShell for VS 2019 .打开Developer Command Prompt/PowerShell for VS 2019 This will set necessary environment variables such as include paths.这将设置必要的环境变量,例如包含路径。
  2. Navigate to the directory of your project.导航到项目的目录。
  3. Type code.键入code. to start VS Code in your current directory.在当前目录中启动 VS Code。

Now, you will be able to use commands like cl , msbuild etc in the integrated terminal.现在,您将能够在集成终端中使用clmsbuild等命令。

Happy coding.快乐编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM