Monday, February 21, 2011

An error has occurred on the server.

Recently I was working on a class library using WSP builder, I stuck with following error once I execute command Copy to GAC.

All of my site stopped working and showing above message. I tried opening Central admin as well, it showed me below error.

I get back to my solution and open output window and I find below messages.

Cannot recycle SharePoint Central Administration v3
Installing Microsoft.Office.Server.dll into Global Assembly Cache.
Installing Microsoft.SharePoint.dll into Global Assembly Cache.
Installing Mydll.dll into Global Assembly Cache.

I just open GAC folder and see the version for above assemblies, which was having older version.
I got to know that WSPBuilder copies all dll files from debug/release folder. At the time of development I had taken this files(above dlls) on my local folder.
I just executed Copy to Gac command and it replaced older SharePoint dll it to GAC.

To overcome this issue I just go to 12 hive (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\)
and open ISAPI folder. I took "Microsoft.Office.Server.dll" and "Microsoft.SharePoint.dll" from here and copied it to GAC and it resolved my issue.

Hope this will help you to resolve your issue as well.

Ashish Chotalia