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"
        }
    ]
}
相关推荐
HarrySunCn5 小时前
如何使用VSCode开发Arduino项目
ide·vscode·单片机·编辑器
知青先生8 小时前
E9项目调试方式
java·ide
面壁的熊猫10 小时前
cursor+cline+MCP(论文agent)
vscode·agent·cursor·mcp
bulucc11 小时前
vim 快捷操作
linux·编辑器·vim
Aspect of twilight13 小时前
vscode python debug方式
ide·vscode·python·debug
Aevget13 小时前
.NET跨平台开发工具Rider v2025.3发布——支持.NET 10
ide·.net·开发工具·rider·rider v2025.3
啃火龙果的兔子15 小时前
vscode中可以使用的免费的AI编程工具有哪些
ide·vscode·ai编程
littlezls15 小时前
在VSCode中运行Python脚本文件时如何传参
vscode·python
宋明炜16 小时前
VSCode + MSYS2 配置 C 语言开发环境(详细步骤)
c语言·ide·vscode
yscript16 小时前
GPU分配BUG: Duplicate GPU detected : rank 1 and rank 0 both on CUDA device d5000
linux·运维·服务器·vscode·bug