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"
        }
    ]
}
相关推荐
还是大剑师兰特7 小时前
VSCode 插件冲突导致崩溃、卡死、假死 全套根治方案
vscode·大剑师
减瓦9 小时前
用 Git 为本地文件打造一台时光机
开发语言·git·编辑器
TunerT_TQ1 天前
Valhalla 静态工程审阅 #009|Continue 源码证据驱动评测【大厂开源基础设施特辑】
vscode·测试工具·开源·llm·github·jetbrains·ai编程助手
时时三省1 天前
VScode 智能插件安装
ide·vscode·编辑器
令狐前生1 天前
Intellij IDEA 2025 破解安装
java·ide·intellij-idea
眞bilibili1 天前
如何快速无缝的从 vscode 转向AI编辑器 cursor、kiro、trae 等
人工智能·vscode·编辑器
知彼解己1 天前
Eclipse Temurin:企业级 Java JDK 发行版的最佳实践
java·ide·eclipse
独隅1 天前
CLion 在 Linux 上的完整安装与配置使用指南
linux·运维·服务器·c语言·c++·ide
山河不见老1 天前
【Cursor 、Qoder安装问题】Cursor 、Qoder安装卡在“正在准备安装”问题排查及解决
人工智能·windows·编辑器
jerryinwuhan1 天前
VScode 安装opencode
ide·vscode·编辑器