How to clean and build solution in visual studio code (.net core2)

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.

Asked by:- LuneAgile
: 11737 At:- 12/6/2018 8:20:40 PM
ASP.NET Clean-build-solution visual-studio-code

2 Answers
profileImage Answered by:- vikas_jk

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 "".

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

At:- 12/7/2018 7:52:44 AM
Good answer, thanks 0
By : pika - at :- 6/3/2022 9:35:14 AM

profileImage Answered by:- LuneAgile

Thanks so much vikas_jk  :) .

At:- 12/7/2018 8:33:50 AM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use