SharePoint 2007 WSP deployment process, restarting SPTimerV3 service - sharepoint

I've got a WF feature which I've been deploying into my development/test environment fairly frequently, and as such have run into an issue where the assembly seems to be cached by the SharePoint Timer service (SPTimerV3), and then an out-of-date version is used after the workflow rehydrates following a Delay Activity.
To fix this, I've tried adding a "NET STOP SPTimerV3" and "NET START SPTimerV3" to my batch file after the STSADM commands to install the .WSP . It works to restart the timer service, and I no longer have the caching problem, however restarting the timer this way seems to kill my SP App Pools in IIS fairly regularly.
Has anyone found a good way to restart the timer in a WSP deployment batch file without adverse affects? Do I need to restart another dependent service, or restart the App Pools each time as well?

you need to restart IIS as well. IISRESET /noforce should do the trick.

Related

Sharepoint 2013 Custom Timer Job running on development server but not on production server

I have developed a custom timer job for SharePoint 2013 in visual studio 2012 which sends email notifications. The issue is that it works fine on development server.
I have followed the following steps to debug it on the development server 1.) Deploy the timer job on respective site. 2.) Restart the timer service in services.msc 3.) Then is do attach to process OWSTIMER in visual studio. 4.) And finally Go to SharePoint 2013 Central administration->Monitoring->Review Job Definition and click on the respective timer job and say run now.
After doing this the breakpoint is hit in visual studio at the Execute() method. So in the development server it is running.
Now on the production server I cannot debug using visual studio so I have deployed the packaged solution(.wsp).
I can see the feature is activated in Site Collection Administration-> Site Collection Features.
Now on the production server I follow the following steps 1.)Restart the timer service in services.msc 2.)And finally Go to SharePoint 2013 Central administration->Monitoring->Review Job
Further to test whether the timer job is working on production server or not I had used PortalLog.LogString("Flow test1"); at the start of the Execute() method. Now this runs on the development server and I see the message in the SharePoint logs but on the production server I can't see "Flow Test1" in the logs after I click Run Now in central admin.
Can anyone suggest what is the issue and a possible solution?
It seems to me that there are two issues:
You should use other way for logging LoggingService should be preferred way. Use WriteEvent to write to EventLog or WriteTrace to write to ULS log.
Running job. Be sure that Owstimer.exe service on all web servers are restarted (can be done by this powershell script). I expect that you have correctly scheduled your job either in your powershell script or in your feature receiver.
Here are a few things to try:
Go to Central Administration and run the timer job from there. Then go to the job history page and check whether it finished successfully or not. If there was an error, you should see the error message from there. That will give you a clue on whats happening.
As Mazin said, restart the timer service in all servers. After deployment, the DLLs are cached by the process and you don't see your changes reflected.
Browse the SharePoint logs and search for an exception or error. You can narrow your search by selecting the timeframe on which your job ran. You can use the following PS script:
Get-SPLogEvent -StartTime "02/02/2014 11:00" -EndTime "02/02/2014 13:00" | Out-GridView
As stated here it seems your job assembly is not deployed in the GAC. Verify that the assembly is present there.

sharepoint solution won't deploy

I'm trying to deploy a SharePoint 2010 solution to our production environment, after starting the deployment process the deployment status keeps saying "Deploying".
At first I thought that the Timer jobs cache was clogging up, but after cleaning the cache and resetting the jobs counter the deployment still won't finish. I also double checked if the SharePoint Timer and Administration were down, but this wasn't the case.
I also reviewed the ULS logs but they don't seem to be holding any serious errors or problems.
Does anyone have a suggestion that might come in handy?
Do you have a different servers on WHich you are deploying your wsp ?
If yes, then check the timezone of that server.
Have a look at this link it may help you
ANother this you can try is :
Did you try the steps described above?
1) Run stsadm -o execadmsvcjobs on your CA server.
2) Run stsadm -o execadmsvcjobs on all the farm members that have stsadm.
4)Restart the Timer Service on all farm members.
5)If still not resolved, then try deleting the timer job that is causing the problem.

MSDeploy not able to delete files

I've got a TFS build set up to build and deploy a web application. I'm passing in the MSDeploy parameters via the TFS build definition's MSBuild arguments. First time round this is working fine. When someone accesses the web app, one of the controls (Microsoft charting control) generates a couple of files in an empty directory I've added to the solution.
When I go to rebuild (or continuous integration is triggered) the next build will usually fail because it can't delete one of the generated files. When I try and manually delete the file it tells me that IIS worker process is using it and it can't be deleted.
Now to get the build building I'd have to manually restart IIS every time, which is not desirable with CI in mind. I've taken a look through Microsoft.Web.Publishing.Tasks.dll and there's nothing there to restart IIS using MSDeploy.
At the moment I'm thinking that adding stubs of the temporary files in the solution might be a resolution (maybe MSDeploy will be able to close the process if the file is a permanent part of the deployment) or I could do some unpleasantness with Exec in the solution file to get an IIS reset.
It's probably a long shot but has anyone come up against this and found a nice solution?
You could use MSBuild Extension Pack to stop the application pool automatically before deployment. There are several tasks in the MSBuild.ExtensionPack.Web namespace to manage IIS, such as stopping and starting an application pool, deleting an application, etc.

Automatically Restarting Website after IIS AppPool recyle

I'm using a website which interacts with SQL Server Agent in order to schedule the automatic processing and emailing of reports. I recently noticed that when the AppPool recyles, that i'm not getting reports afterwards - until someone logs into the website again. It's possible for the website not to get hit for hours/days, during which all the scheduled tasks are lost.
I'd like to set up a windows task to either run periodically or trigger off the AppPool recycle event. But I'm not sure what the task should be. I had one suggestion to set up a Windows task to exercise a .js script that would hit the website, but this only works with Windows Authentication (which isn't being used):
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("POST", "http://localhost/website/default.aspx", false);
xmlhttp.send();
Looking for some suggestions on how to "wake up" a website after an IIS AppPool recycle.
Thanks.
ab.
Why not run gnu wget from a scheduled task:
wget -O - http://mysite.com/default.aspx
I ran across this today which seems like it might help you out. It's the IIS Warm-up module. Depends on whether you can convince the your customer to install it, although it is an official IIS module, so hopefully it's no problem.

deploying to sharepoint using the object model doesn't work reliably

Deploying to sharepoint using the object model or STSADM commands sometimes results in one or more packages being in the "error" state in the web control, a redeploy instantly fixes this, usually, even stranger, if i create two apps one which adds and one which deploys then i get no problems, but putting a delay between a single program does not have a similar effect.
If i run the deploy twice for programs which did not deploy successfully it works fine, as long as I do not try to do it programatically in which case it makes no difference.
It is different files and sometimes is none.
I do use stsadm -execadmsvcjobs between add and deploy and even between two of the deploy bunches.
(i'm deploying around 10 wsp files programatically)
Does anyone have any ideas on why this happens? or how to solve it, as when i get to implementations it causes problems.
The problem lies in the fact that sharepoint will perform app pool recycles and / or full iisresets, as well restarts of the SharePoint Timer Service (altough not completely sure about that though). When you try to actually deploy the just installed package sharepoint is still busy getting up and running again, the timer job created to install / deploy is basically waiting for the central admin app pool to be fully running again.
The same thing happens (somewhat reproducably) while retracting a solution. Hit F5 a lot of times on the solution management page while the retract process is underway and if you refreshed fast enough it will hang and display "error" in red.
My solution was to create a WebRequest to at least the central admin (or just do a SPSite = new SPSite("centraladminurl")) in your deployment app or in powershell. Do this after every deploy action as well.
This SHOULD fix the timing issue (basically a kind of "race condition").

Resources