How to automate/execute multiple ASP.NET Core commands in Visual Studio Code?
For example, execute dotnet clean
,dotnet restore
, dotnet build
etc in a single go..
I was going to ask this question but instead found a solution for the same. So sharing this with the community.
If you are using Visual Studio Code to develop ASP.NET Core apps you can automate
dotnet restore
,dotnet build
,dotnet run
,dotnet clean
commands using a short one with the help ofdoskey
.Now, by entering
c
,b
,r
,rr
orp
will execute their respective command(s) on the integrated terminal window of Visual Studio Code. You can bind multiple commands together using$T
. For eg:Entering
cb
,crb
,crbr
,crbp
orrbp
will execute their respective multi-command(s).These shortcuts will flush away when Visual Studio Code is restarted so to keep them persistent, save these commands as a batch file(eg: doskey.bat), and then open your
usersettings.json
file in Visual Studio Code and add these lines (these settings are for Command Prompt as terminal window) :