I have a solution in Visual Studio 2010 that is made up of 3 projects.

I have one project for my SharePoint 2010 custom timer job, one project (Project A) that is used by my custom timer job, and another project that is used by Project A.

The problem is that when I package my project the WSP only installs the Custom Timer Job to the GAC. Is there some way to have all dependant DLLs installed as well?

2 Answers 2

  1. In the Timer Job project, open the package designer.
  2. Click Advanced (bottome of the designer)
  3. Click Add, and choose Add Assembly from Project Output.
  4. Select Project A

  5. Repeat selecting the other project.

All your assemblies will be in the Timer Job solution, and is the only one you need to deploy to SharePoint.

  • Ok, awesome. I got it to Add/Install alright but I don't see the assembly for Project B in my GAC. When the job tries to run i get this error: Could not load file or assembly 'ProjectA, Version.........' or one of its dependencies. The system cannot find the file specified. Any idea why it's skipping the last one? Commented Mar 29, 2011 at 20:56
  • Review the ULS logs to see if there was an error during deployment. Commented Mar 29, 2011 at 21:20
  • I looked a little more closely and it looks like it is trying to find the wrong PublicKeyToken. Do you know why this would happen? Commented Mar 29, 2011 at 22:06
  • If you're the author of all three projects you should really be using the same SNK for all three projects.
    – James Love
    Commented Mar 29, 2011 at 22:13
  • All three have the same PublicTokenKey, but for some reason it's looking for a different one when it runs Project A Commented Mar 29, 2011 at 22:16

One problem having "shared" references in your main WSP is that if it is shared and you retract the WSP you will make all other solutions fail.

I tend to use a specific WSP that contains the shared references - this makes me avoid these kind of problems.

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.