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:
- Reference all the assemblies from GAC. As a result adding a reference in the website will not create a Bin folder.
- 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:
https://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/