vscode编译调试sln工程

使用msvc工具链

vscode配置调用visual studio的编译和调试环境_vscode用vs-CSDN博客

将vscode打造无敌的IDE(14) tasks.json和launch.json配置详解,随心所欲添加自动化任务_tasks.json详解-CSDN博客

通过命令行使用 Microsoft C++ 工具集 | Microsoft Learn

编译task.json

html 复制代码
{
    "version": "2.0.0",
	"windows": {
		"options": {
		  "shell": {
			"executable": "cmd.exe",
			"args": [
			  "/C",
			  // The path to VsDevCmd.bat depends on the version of Visual Studio you have installed.
			// 仿制"Developer Command Prompt for VS 2019.lnk"
			  // "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/VsDevCmd.bat\"",
			  // cmd> vcvarsall.bat --help
			  "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat\" x64",
			  "&&"
			]
		  }
		}
	  },
    "tasks": [
        {
            "label": "Build Solution",
            "type": "shell",
            "command": "msbuild",
            "args": [
                "/t:Build",
                "/p:Configuration=Debug",
                "Project.sln"
            ],
            "group": "build",
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        }
    ]
}

调试的launch,json

html 复制代码
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Debug/Placement.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "visualizerFile": "${workspaceFolder}/.vscode/visualizers.json",
            "visualStudio": "Path to your MSVC installation"
        }
    ]
}
相关推荐
南知意-6 分钟前
IDEA 2026.1最新版安装教程
java·ide·intellij-idea·idea安装·idea激活
隔窗听雨眠1 小时前
Typora插件开发指南:从零打造IDE级写作环境
ide·typora
专注_每天进步一点点3 小时前
IDEA中,Apifox Helper 的 2.0.15-243版本的插件 导出指定的接口,入参的中文名为空,描述为空
java·ide·intellij-idea
郝亚军3 小时前
如何在vscode上运行python程序
ide·vscode·编辑器
Arvin.Angela3 小时前
VsCode 安装文档
ide·vscode·编辑器
郝亚军4 小时前
Visual Studio 2022安装for C++桌面开发
c++·ide·visual studio
CAir24 小时前
copilot配置deepseek和skills
vscode·copilot·skill·deepseek
北凉军5 小时前
更换PyCharm 任务栏图标
ide·python·pycharm
c238565 小时前
Vim 高阶实操技巧篇
linux·编辑器·vim
c238566 小时前
Vim 零基础核心基础篇
linux·编辑器·vim