Hi, I want to build and clean my project solution in visual studio code, but I can't find the option of clean and build in visual studio code, like we clean the project by clicking right project and click on "Clean" or "Build" in Visual Studio.
How can I do the same thing in visual studio code. Thanks.
There isn't any inbuilt button of Build/Clean like Visual studio 2015/2017 in Visual Studio code.
Try a custom build task in your task.json.
Open VSCode settings and search for "terminal.integrated.shell".
If you are using PowerShell as your integrated terminal, then use the following build task in your task.json file.
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "dotnet clean; dotnet build",
"args": [
]
}
]
}
If you are using cmd or bash as your integrated termininal, then change the command to this:
"command": "dotnet clean && dotnet build",
Then hit your VS Code debug button.
That assume you already have the default launch.json file with "preLaunchTask": "build" in it.
OR Integrate external tools as described here https://code.visualstudio.com/docs/editor/tasks
Thanks so much vikas_jk :) .
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly