Quantcast
Channel: Periwinkle IT » Uncategorized
Viewing all articles
Browse latest Browse all 4

Timer Job code doesn’t appear to work…..

$
0
0

When making changes to a SharePoint 2010 timer job, deploying (via Visual Studio) and then debugging I was coming across a problem where the code just didn’t work.

I added code into the Execute method to just assign a value to a string:

Code Snippet
  1. String testString1 = "I would like ";
  2.             string testString2 = "a cheese sandwich ";
  3.             var testString3 = "very much";

However, although the debugger stepped into this code, the string values were null.

To fix this, you need to restart the SharePoint timer service each time you deploy

image

And you may need to do this twice Winking smile

I just added the following in Visual Studio to my post deployment command line options:

net stop “SharePoint 2010 Timer”
net start “SharePoint 2010 Timer”
net stop “SharePoint 2010 Timer”
net start “SharePoint 2010 Timer”



Viewing all articles
Browse latest Browse all 4

Trending Articles