我刚开始学习如何在Vscode中使用C#,但无法生成Json文件来调试解决方案中的不同项目。
对于上下文,我有两个项目,Test 01和Test 02。Json文件看起来像这样:
Launch.json:
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Test01/bin/Debug/net7.0/Test01.dll",
"args": [],
"cwd": "${workspaceFolder}/Test01",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
Tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Test01/Test01.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Test01/Test01.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/Test01/Test01.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
我正在尝试配置vscode来开始学习C#,使用Vscode解决方案资源管理器扩展在同一个解决方案中添加多个项目,但是当我生成launch.json和tasks.json文件时,它们只添加了其中一个项目的路径。我应该创建多个发射/坦克配置(每个项目一个),还是有更好的解决方案?
1条答案
按热度按时间pvcm50d11#
只需在各自的文件中复制现有的配置和任务。
Launch.json
Tasks.json