Using Web Deployment Project in Visual Studio 2005

 

Issue

====

One of my colleague developed ASP.NET 2.0 application in Visual studio 2005. During the development phase he referenced few assemblies from a shared directory that were not in GAC. As a result, all the referenced assemblies were copied in Bin folder. Now he wants a functionality to exclude all those assemblies that are present in bin folder as soon as he publishes the website to other location.

Resolution

========

There are two ways to achieve the above functionality:

  1. Reference all the assemblies from GAC. As a result adding a reference in the website will not create a Bin folder.
  2. Use Web Deployment Project utility where we can exclude the paths when ever the build will happen in its configuration file like:

<ItemGroup>

    <ExcludeFromBuild

          include="$(SourceWebPhysicalPath)\Bin\*.*"/>

      </ItemGroup>

For more information on Web Deployment project, visit the following links:

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/

http://download.microsoft.com/download/1/5/4/1541980a-d8fc-407b-8c9f-c2df5445b041/Using%20web_deployment_projects_final.doc