Monday, June 21, 2010

Deployment - Xcopy

Deployment has always been a pain area for SharePoint developers. However the good news is in SharePoint 2010 the deployment process has eased off a lot. Although the use of WSP
Builder also helps a lot for creating wsp solution packages for deployment. But during the development phase it still remains a cumbersome job for copying different file in different folder such as the putting the assemblies in the GAC or a BIN folder. I reduce this redundant process I prefer to use the install.bat file where I keep all my post build commands (incase the solution is big) otherwise, I keep the commands in the post build. Let us see the below example – here, I am putting the dlls in a separate folder Deployment\bin and other pages such as aspx, ascx in Deployment\Pages and Deployment\UserControls respectively.

The Deployment folder is in C drive:-

C:\Work\Projects\Deployment\bin

xcopy /y "$(TargetDir)*.dll" "C:\Projects\Deployment\bin\*.dll"

xcopy /y "$(projectdir)*.aspx" "C:\Projects\Deployment\Pages\*.aspx"

xcopy /y "$(projectdir)*.ascx" "C:\Projects\Deployment\UserControls\*.ascx"

On successful build of the project, this script will copy the required dlls and file at designated folder… Hope this information might help other… J

More information on XCopy:

http://commandwindows.com/xcopy.htm, http://www.15seconds.com/Issue/030806.htm, http://support.microsoft.com/kb/326355

……. HaPpY CoDinG

Partha (Aurum)


 

1 comment:

  1. xcopy /y "$(TargetDir)*.dll" "C:\WINDOWS\assembly\gac_msil\UserControls\1.0.0.0__3ef1af4ca3a3cbad\*.dll"
    xcopy /y "$(projectdir)*.ascx" "C:\Inetpub\wwwroot\wss\VirtualDirectories\777\UserControls\*.ascx"
    This is a better option of deploying dll in gac

    ReplyDelete