Deploying assemblies with WSPBuilder

By default WSPBuilder puts all referenced assemblies from the Setup project into GAC. I use the following to control that behaviour:

  1. Set the output directories of the dependent assemblies to either 80\bin or GAC in the setup project.
  2. The assemblies that some where referenced in a dependent assembly that should not be deployed: Reference in Setup project and set ‘copy local’ to false.
  3. Post build script to do delete the bin folder of the Setup project. This will delete the assembly created for the Setup project. I never put any code in the Setup project.

I use the following post build script that does different things on what configuration you are building:

if $(ConfigurationName) == Debug $(ProjectDir)PostBuildDebug.bat $(ProjectDir)

@echo off
rem Provide the project directory as parameter.
echo Clean-up of files for WSP builder.
rmdir %1\bin /s /q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.