0

I keep getting this error in my windows logs:

 SharePointSocialNetworking.Facebook 
   b0ceb144-b183-4b66-aa10-39fd9ee42bd4 
   Could not load file or assembly 'Microsoft.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16' or one of its dependencies. The system cannot find the file specified. 

But the assembly it's talking about already shows in my GAC:

alt text

Am I missing something here? Everything in the GAC matches the error message. How could windows not find this?

Dustin Laine
  • 37,935
  • 10
  • 86
  • 125
Abe Miessler
  • 82,532
  • 99
  • 305
  • 486

3 Answers3

1

Add a SafeControl entry to your web.config:

<configuration>
...
  <SharePoint>
  ...
    <SafeControls>
      ...
      <SafeControl Assembly="Microsoft.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16" Namespace="Microsoft.Contracts" TypeName="*" Safe="True" />
    </SafeControls>
  ...
  </SharePoint>
...
</configuration>
Abe Miessler
  • 82,532
  • 99
  • 305
  • 486
theChrisKent
  • 15,029
  • 3
  • 61
  • 62
  • 1
    I suppose I should make sure you are using SharePoint (I assumed since the error has SharePointSocialNetworking). If so, adding a safe control entry allows SharePoint to use the assembly. Without this entry or an assemblies entry, it will not use it even if it is deployed to the GAC. – theChrisKent Nov 23 '10 at 19:36
  • Hmm, I am using SharePoint but I added several other assemblies and it's not throwing this error for any of them (Microsoft.Contracts is called through one of them so I assume they are fine). – Abe Miessler Nov 23 '10 at 19:53
  • I tried this and now my admin errors out. Does it matter that this is being used by a Custom Timer Job? – Abe Miessler Nov 24 '10 at 20:52
  • Does your admin give an error - if so what is it? Have you verified that removing the SafeControl entry removes the error? Double check the namespace (I was guessing in the example above). The Custom Timer Job shouldn't make a difference. – theChrisKent Nov 24 '10 at 20:55
  • Ok, it looks like it was cause by me putting having `NameSpace` instead of `Namespace`... I added that and I'm still getting the same error. – Abe Miessler Nov 24 '10 at 22:06
0

It doesn't just have to find the Microsoft.Contracts assembly but ALL of its dependencies. You need to see what dependencies that assembly has and make sure they all are also in the GAC.

Achilles
  • 11,165
  • 9
  • 62
  • 113
  • When I opened it in reflector all it had was `System` and `Mscorlib`. Those are both in the GAC. That's all i need to check right? – Abe Miessler Nov 23 '10 at 19:27
0

You can find the library here C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll

Korayem
  • 12,108
  • 5
  • 69
  • 56