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"
        }
    ]
}
相关推荐
三更两点1 小时前
第196期 TRAE 与 Amazon Kiro 智能体驱动集成开发环境(Agentic IDE)对比
ide
西风未眠12 小时前
高效编辑之vi/vim常用快捷键汇总
linux·编辑器·vim
ol木子李lo13 小时前
Visual studio 2022高亮汇编(ASM)语法方法
汇编·ide·windows·visual studio
温轻舟14 小时前
Python自动办公工具01-Excel文件编辑器
开发语言·python·编辑器·excel·温轻舟
WarPigs17 小时前
Unity编辑器开发笔记
unity·编辑器·excel
(づど)1 天前
解决VSCode中安装Go环境Gopls失败的问题
vscode·golang
曹牧1 天前
Eclipse为方法添加注释
java·ide·eclipse
zandy10111 天前
2025年11月AI IDE权深度测榜:深度分析不同场景的落地选型攻略
ide·人工智能·ai编程·ai代码·腾讯云ai代码助手
youngerwang1 天前
【字节跳动 AI 原生 IDE TRAE 】
ide·人工智能·trae
youngerwang2 天前
AI 编程环境与主流 AI IDE 对比分析报告
ide·人工智能