Thursday, 3 April 2008

Failure in loading assembly

The other day in a meeting someone asked “Is cynicism really necessary?” I could not help myself but reply with “It’s as necessary to me as your skepticism is to you” while writing down on my notebook recommendation one down size the unbeliever.

Anyway moving on to my article of the day…

You see the following error reappear in the Windows event log with regular intervals:

Event Type: Error
Event Source: Windows SharePoint Services 2.0
Event Category: Devices
Event ID: 1000
Date: 17/08/2005
Time: 14.05.10
User: N/A
Computer: XXXXXXX
Description:
Error: Failure in loading assembly:
xxxxxxxxxxxxxxxxxxxxxxxxxx, Version=x.x.xxx, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx

Then you have one of two things ether (1) you’ve removed a webpart and the entry remains in your web.config file or (2) you’ve changed version and the old entry is till in your web.config ether way don’t panic

First of all its not a problem unless this error is causing your work process to crash and taking down the IIS server with it.

The second thing is that like all do good administrators your going to create a backup before you start aren’t you… this is the bit where you say yes an nod your head.

OK the process is quite easy really you copy you web.config file some where can even be in the same directory, this will be you way out if you make mistakes.

Now open the original web.config file with notepad and find the entry’s that corresponds to your error and example of this lets say your error message is

Event Type: Error
Event Source: Windows SharePoint Services 2.0
Event Category: Devices
Event ID: 1000
Date: 17/08/2005
Time: 14.05.10
User: N/A
Computer: XXXXXXX
Description:
Error: Failure in loading assembly:
ButterFly.Systems.SharePoint, Version=2.2.0.17, Culture=neutral, PublicKeyToken=a8c2b621921b493b

So in your web.config file you should fine a entry with the same version number name and/or public key token, based on the error above I should find a line in my web.config file like the one below, just delete this and save the file. BE SURE NOT TO DELETE OTHER LINES as you may stop other things working and have to restore from the backup file.

SafeControl Assembly=" ButterFly.Systems.SharePoint, Version=2.2.3.117, Culture=neutral, PublicKeyToken=a8c2b621921b493b" Namespace=" ButterFly.Systems.SharePoint.WebControls" TypeName="*" Safe="True"

Once you’ve safely removed the entry’s and saved it just reset IIS if all when well you sites are still running and you should see no more errors in the application log, and you can safely remove your backup.

If all did not go well stop IIS and restore you backup then restart IIS and try again.

See simple really. :-)

No comments: