Alex Rivera | Logout

How to cancel Visual Studio build using command line?

Asked 2012-03-01T04:18:44.400
10

When I run a build, sometimes I see a code change I forgot. So I want to cancel the build. Due to the build locking up my IDE, I have to use Ctrl+Break, however, it does not respond fast enough.

I am looking for a command line approach so I can just hit a batch file in my quick launch. I tried this command:

Taskkill /IM aspnet_compiler.exe /F

However, this only stops the current project from building and the next one in my multi-project solution starts up.

How can i cancel a build using command line?

Edit
Report

1 Answer

1

I have come up with a crude method which is working well for me.

I have the following batch script.

@echo off
echo KILL BILLd
for /L %%i in (1,1,10) do (
   Taskkill /IM aspnet_compiler.exe /F
   timeout 1
)

(Above, 10 = seconds)

I then make a shortcut of that batch script in the same folder which allows me to do the additional.

  • Assign an icon image for my quick launch bar.
  • Set it to execute minimized.
  • Assign a global short cut key combo.

In VS2010, I have set up CTRL+SHIFT+B as my build all. (not rebuild).

For the shortcut and since my fingers usually are still hoving in the area when I see a forgotten code change. My batch shortcut key combo is CTRL+SHIFT+ALT+B.

answered 2012-03-18T23:01:09.877

Your Answer