Problem is if this process doesn't exist, build fails. I try to write something like this
tasklist /nh /fi "imagename eq XDesProc.exe" | find /i "XDesProc.exe" && (
TASKKILL /F /IM "XDesProc.exe"
) || (
echo XAML designer is not running
)
But ERRORLEVEL is equal to 1 too and bild fails if XDesProc.exe is not running.
In the task Runner Explorer window, you'll see a tab that has "(running)" in it's title. Click the X to close the tab, and visual studio will ask you if you want to terminate the task. If you chose to terminate it, the tab will disappear. Show activity on this post.
In Task Manager, if you go to the applications tab, you can right click on the instance you want to kill based on the name, then click on "Go to process". It should select the process you want to kill. Show activity on this post.
You could use a conditional test on the PID to avoid this:
taskkill /f /fi "pid gt 0" /im xdesproc.exe
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