You can have a separate folder for deployment of type \ Build_Archive, where the output is also copied - and add some lines to the assembly script to copy your assemblies, but not satellites to these folders - this way, Build_Archive always has only the files necessary for deployment.
i.e. my current copies of the script are copied to the folder labeled build # and to the current folder - so Current always has the last value, and we save the history of previous builds - for example:
C:\Build_Archive\AppName\Current C:\Build_Archive\AppName\1.0.0.1 C:\Build_Archive\AppName\1.0.0.2
So, something like this at the end of your build script (replace <values> with your stuff. The script uses an external DLL to control version numbers, etc., so it doesn't turn on here):
<DropLocation>\\<serverName>\Build_Archive\${BuildDefinition}</DropLocation> <PropertyGroup> <VersionMajor>1</VersionMajor> <VersionMinor>0</VersionMinor> <VersionService>0</VersionService> <VersionBuild>0</VersionBuild> </PropertyGroup> <Target Name="BuildNumberOverrideTarget"> <PropertyGroup> <BuildNumber>$(BuildDefinitionName)_$(VersionMajor).$(VersionMinor).$(VersionService).$(VersionBuild)</BuildNumber> </PropertyGroup> <Message Text="Build number set to "$(BuildNumber)"" /> <Message Text="$(SolutionRoot)"/> </Target> <Target Name="AfterCompile"> <CallTarget Targets="CleanUp"/> <CallTarget Targets="StageBuild"/> <CallTarget Targets="CopyFiles"/> </Target> <Target Name="CleanUp"> <Message Text="**** Entering::CleanUp ****"/> <CreateItem Include="\\<server name>\Build_Archive\<appName>\Current\**\*.*"> <Output ItemName="PreviousFiles" TaskParameter="Include" /> </CreateItem> <Delete Files="@(PreviousFiles)" ContinueOnError="true" /> </Target> <Target Name="StageBuild"> <ItemGroup> <BldCurrent Include="\\<server name>\Build_Archive\<appName>\Current\"/> </ItemGroup> <Message Text="@(BldCurrent)"/> <Message Text="$(SolutionRoot)"/> <!β Here β replace next line with commands to copy only the files you want to deploy --> <Exec Command="xcopy /y /r /e $(SolutionRoot)\..\bin\*.* @(BldCurrent)"/> </Target> <Target Name="CopyFiles"> <Exec Command="xcopy /y /r /e $(DropLocation)\Current\Debug\*.* $(DropLocation)\$(BuildNumber)\Debug\"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.config"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.dll"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.exe"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.application"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.pdb"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.txt"/> <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.xml"/> </Target>
source share