I am using Microsoft SharePoint Guidance for logging and exception handling in my SharePoint timer job, my solution in SharePoint 2007 worked perfectly (and is working).

Right now I am in the process of upgrading my solution to Visual Studio 2010, I took new version of SPG for SharePoint 2010 and compiled the assemblies.

However I am getting following exception, seems that Service Location assembly is not being loaded correctly, I have removed the assembly reference multiple times I am not sure what is going wrong with loading the assembly.

Any Pointers?

Log Name:      Application
Source:        Microsoft-SharePoint Products-SharePoint Foundation
Date:          10/25/2012 11:52:00 AM
Event ID:      6398
Task Category: Timer
Level:         Critical
User:          NETWORK SERVICE
The Execute method of job definition Halliburton.SharePoint.SiteAudit.SiteAddTimerJob (ID ab997783-7c34-4e5d-bade-30ea57ef1a0c) threw an exception. More information is included below.

Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

2 Answers 2


Thanks a lot for your replies, it seems that some old version of DLLs are being held in the memory. I run IISRESET command and restarted the Timer Service and the error was gone.

So problem to the solution is the Microsoft Way -- RESET :)

"Sudhir Kesharwani"


You could try adding that DLL to the GAC (Global Assembly Cache) using gacutil or copying it to the BIN folder of the SharePoint web app directory in inetpub...

  • My Solution Package does the GAC installation, I am able to see the assembly installed in the GAC Commented Oct 25, 2012 at 18:01
  • Does that DLL have any reference DLLs that are missing? You can use tools like .NET Reflector to open the DLL and see what it references. Commented Oct 25, 2012 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.