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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s