Monthly Archives: January 2012

PowerShell Install-SPSolution trouble

Hey People,

A moment ago I deployed a solution with PowerShell and I’ve received a weird error. Atleased not weired but it did not made me happy. This is what I did,

  • Add-PSSsnapin Microsoft.SharePoint.PowerShell
  • Add-SPSolution “C:\MySharePointSolution.wsp
  • Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment

Then I did, Get-Solution and I saw my newly installed sollution was False. In de Central Admin Console I found an error.

SERVERNAME : Failed to create receiver object from assembly “MySharePointSolution, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXX”, class “SomeNamespace.Features.Lists.ListsEventReceiver” for feature “SomeNamespace_Lists” (ID: {GUID}).: System.ArgumentNullException: Value cannot be null.

First I checked all the SharePoint Windows Timer Services if they where running and yes this was the case.

Then somebody on the web pointed out just to stop and start the timer service of the WFE servers because of a DLL that would be cached and causing trouble. So I stopped and started the Timer service and deployed it again. Only this time I’ve got an other error that there already was a solution. SharePoint suggested to add -Force and that was the trick, it worked like a dream.

So in the end of this story the clue is resetting services can do magic.


Clearing the SharePoint configuration cache

Sometimes it happens that things just don’t run as they did before. I experience this a lot on MOSS 2007 farms which only have SP2 and nothing else. Most of the time stopping and starting Windows Services help to fix the problem only their are always exceptions 🙂

Before you try the megical reboot who solves weird problems alot you can check two more things because you can not just reboot during office ours but want to solve the problem a.s.a.p. right?

  • Check the disk space of your SQL server or LUNS
  • Clear the SharePoint configuration cache

Steps

When your clearing the cache nobody will notice because you can do it really quick. The only thing it affecs are the SharePoint Timer Jobs which you have to disable in the windows services.

Anyways here’s how to do it.

  1. Open the Windows services (services.msc) and open this screen for as many servers as you have.
  2. Choose connect to another server at the actions option in the pull down menu and establish the connection (just put them side by side with flag +Windows key).
  3. Stop the Windows SharePoint Service Timer on all servers.
  4. Open the following folder on all servers \\HOSTNAME\Documents and and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID\
  5. Use ctrl+a to select all files scroll till you see a small file (in character length) cache.ini and by pressing ctrl + klik with the mouse one file is deselected. and you can delete all (So not the cache.ini file 🙂 !!!).
  6. Open the chache.ini with notepad and replace the random number with “1” and save the file.
  7. Do this on all servers and the moment you start the Timer service again the cache files will be appearing again.

Hopefully this trick solved your problem if not it’s back to the drawing board.


Visual Studio Team Foundation Service in the cloud

Wow, I knew about TFS for working together on code projects but TFS in the cloud makes everything even easier. This is cool stuff even for a beginner in Visual Studio like me.

Check out the cool demo video Microsoft provided or try it for your self on the demo site.

http://tfspreview.com/