March 23, 2010 at 3:29 PM
I had some fun in converting my build/deploy scripts. These scripts are made to build and deploy a BizTalk project with one click on your local development machine to avoid to much clicking. The scripts are making use of MSBuild.
On my current project, the development BizTalk Servers are remote machines, the scripts were still working fine, except adding an assembly to the GAC on the remote machine caused some problems.
The first step to add an assembly is finding the right MSBuild task to do this. I'm using the MSBuild extension pack, this extension pack contains a GAC task (makes use of Gacutil.exe). The task is used as follows:
<MSBuild.ExtensionPack.Framework.Gac TaskAction="AddAssembly" AssemblyPath="$(asseblyPath)" RemoteAssemblyPath="$(remoteAssemblyPath)" MachineName="$(Server)" Force="true" />
As taskaction, I choose 'AddAssembly', specify a local and remote assembly path and a machine name (the remote server). If your user account does not have the necessary privileges to add the assembly to the remote GAC, you can specify a remote user/password combination.
Although this looks ok, this is not enough...
The remote machine is a server, without the .NET 2.0 SDK installed. The gacutil.exe tool is shipped with the .NET 2.0 SDK. We could install the .NET 2.0 SDK but it is enough to deploy gacutil.exe on the remote server.
This still did not work...
One final thing should be done! The GAC MSBuild task does not know where to find gacutil.exe. To fix this, we must add the path to gacutil.exe to the PATH environment variable.
If these three steps are done, we can GAC our assembly on the remote machine....