I am working with WSS 3.0, Visual Studio 2008, and WSPBuilder 0.9.9. I have a custom class library (WebParts.dll) of base classes that I use with several SharePoint solutions. I currently deploy WebParts.dll to the GAC, and add it as a reference in each solution. My current arrangement works fine, but I have to manually deploy the DLL to the GAC on each web server when it changes.

I would prefer to either (a) wrap WebParts.dll in a WSPBuilder or VseWSS solution that can be deployed just like any other solution, or (b) include WebParts.dll in the 80/bin folder in each solution.

Which would be the preferred method to deploy my dll, and can someone point me to step-by-step instructions online? I found this blog post describing some of part b, but I think I am missing a step:


Thanks for your help!

1 Answer 1


If your DLL is placed in the bin\debug or bin\release folders of your project (e.g. "Copy Local" equal to true for your DLL Reference), the DLL will automatically be included in your WSP and deploy according to the DeploymentTarget of your local WSPBuilder.exe.config file.

If you are sharing the same DLL across multiple projects, it might make more sense for you to package the shared DLL in it's own feature/deployment package and utilize feature activation dependencies within your other projects to ensure the DLL has been deployed.

You may need to upgrade to a more recent version of WSPBuilder. I believe 1.0.5 is the first release to support local config support.

Hypothetical Setup

  • My Web Parts (VS Solution)
    • WebParts (VS Project) - This contains your base DLL (WebParts.DLL) that you want to utilize within your other projects
    • MyWebPart1 (VS Project) - This project is one of your web parts. Add a project reference to the WebParts project and do not copy the WebParts.DLL locally.
    • MyWebPart2 (VS Project) - This project is one of your web parts. Add a project reference to the WebParts project and do not copy the WebParts.DLL locally.

When you build the VS projects WebPart1 or WebPart2, the reference will resolve in Visual Studio.

  • Thanks! Your second paragraph is my option (a), which I think is the better way to go. Could you provide a link to a walkthrough on wrapping a DLL within a WSPBuilder solution? I feel I am close to a solution, but need that aha moment to make it work.
    – CigarDoug
    Sep 16, 2011 at 12:01
  • @cigardoug If your goal is to deploy a single DLL in it's own WSP you could do the following: 1. Create an empty WSPBuilder Project 2. In the root of your project, create a folder called GAC 3. Place your DLL in the GAC folder 4. Package and Deploy your solution.
    – ciphertxt
    Sep 16, 2011 at 13:17
  • Thanks for the quick reply, and I imagine that will work. The only problem is, I have to make two solutions, one that generates WebParts.dll and one that wraps WebParts.dll in a solution, WebParts.wsp. I guess what I was looking for is a way to create ONE WSPBuilder solution, add the classes to the solution like I would add WebParts or EventHandlers to a solution, then deploy the solution. Is this feasible, or am I just going about this the wrong way?
    – CigarDoug
    Sep 16, 2011 at 16:18
  • @cigardoug You can do that in one solution. Create a new empty WSPBuilder project called WebParts. Add your classes. Compile --> Package --> Deploy.
    – ciphertxt
    Sep 16, 2011 at 19:05
  • Which is exactly what I have been trying for two days, without success. I am certain I am missing something so obvious, I will slap myself when I figure it out. OK, so here is the question: The example you gave, how do other solutions refer to it? Does it generate a DLL and add it to the GAC? Do you make a reference to WebParts from the other solutions? Is there a step-by-step online that I can read through and figure out just what I am missing here?
    – CigarDoug
    Sep 16, 2011 at 19:21

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.