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"
        }
    ]
}
相关推荐
疏狂难除12 小时前
JetBrains IDE插件开发教程(五)——File Header
ide·kotlin
Soari15 小时前
【突发暴更】Claude Code v2.1.208 :无障碍辅助模式正式上线、Vim 连击热键出逃、大修内存泄漏与跨域 AWS SSO 登录崩溃!
编辑器·vim·aws·claude code
harmful_sheep19 小时前
idea相关设置
java·ide·intellij-idea
蓝冰凌21 小时前
vscode 用户级 settings.json
ide·vscode·json
九九落1 天前
VSCode AI编程完全指南:从环境搭建到实战应用
ide·vscode·ai编程
DevangLic2 天前
【第一次使用Visual Studio 2026+使用claude 拓展】
android·ide·visual studio
开发者联盟league2 天前
vscode接入deepseek
vscode·deepseek
小小放舟、2 天前
VS Code Code Runner 中文乱码修复与 IDEA 风格输出配置
vscode·python·code runner
开发者联盟league2 天前
vscode接入deepseek实现inline suggestions
vscode·编辑器
木卫二号Coding2 天前
Vdit 实现所见即所得(WYSIWYG) 模式的 Markdown 编辑器
编辑器