Problem with updating code run from Async Events? No worries

Exactly no worries just make the following script bat or ps1:

net stop SPTimerV4
net start SPTimerV4
iisreset /noforce
net start W3SVC

Save the script into the root of the project and set it the file to “Do not copy”. Then add the script to your “Post deployment command line”

Like so:

%windir%\sysnative\windowspowershell\v1.0\powershell -file “$(ProjectDir)PSDeploy.ps1”

The $(ProjectDir) will automatically pick up in visual studio for you.

Job done, the timers and iis will reset and ensure they are fully restarted after every deployment.

Note this works in a local development environment only, to do this remotely you can do the same by enabling remote powershell and changing the command to suite.

© Hugh Wood 1980-Present