I have been working on an empty SharePoint 2010 project in Visual Studio 2010 and everything works as it should until I try to call a certain external assembly - adding a reference to the assembly alone (in solution explorer) is not problematic, but trying to use the assembly in code causes

"Error: Could not load file or assembly ', Version=, Culture=neutral, PublicKeyToken=...' or one of its dependencies. The system cannot find the file specified."

I have no idea why. Here's what I know:

  • assembly with the same name, version, culture and public key token is installed in GAC;
  • I have included the assembly in the project package (Package.package - advanced - Add assembly).
  • It makes no difference whether or not I specify (in package) 'safe controls' - right now, I have 'Safe' checked, Namespace set to assembly namespace, type = *, Assembly name = empty, 'Safe against script' unchecked.
  • The assembly platform target is 'Any CPU', .NET 3.5 - same as the SharePoint project.
  • If I create a normal C# console app ('Any CPU' target), I can reference and use the same assembly normally - no error occurs.

Anybody ever had a problem like this?

1 Answer 1


Somehow, after struggling for days with this, I managed to solve it minutes after posting it here ...

What I did to resolve this was to right-click the project in Solution Explorer -> WSPBuilder -> Uninstall, then Build WSP & Deploy again. Seems there was an old .wsp file that was not getting replaced by simply right-clicking project -> Deploy.

  • Oh, I did not know that rule, sorry ...
    – banana
    Sep 12, 2013 at 14:35

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.