In VS Code, I have the following C# projects:
- Common/Common.csproj
- WebApi1/WebApi1.csproj
- WebApi2/WebApi2.csproj
And my tasks.json is the following:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/WebApi1/WebApi1.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
When I hit debug selecting the WebApi1 profile, my launch.json runs the task build (defined in the previous code section) and this tasks builds the WebApi1.csproj project alongs with Common.csproj, because Common is defined as a dependency.
My question is: how can I use the same task to build WebApi1 AND the WebApi2 (and WebApi3, WebApi4, etc.), which means one task to build all projects in the repo.
I've tried "${workspaceFolder}/**/*.csproj" but this syntax was not accepted.
As a possible solution, you can place all your projects into one single solution and specify in a build task, something like that
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/solution.sln"
],
"problemMatcher": "$msCompile"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With