Developer productivity–script to deploy an assembly quickly to Global Assembly Cache (GAC)


Very often we want to deploy the assembly to GAC and test our work, without having to follow a quick deployment process. here is a script which does the assembly deployment (uninstall the old one and install a new version).

$ProgamFiles_x86 = "$env:ProgramFiles (x86)"

#configure GacUtil environment
set-alias gacutil "$ProgamFiles_x86\Microsoft SDKs\Windows\v7.0A\bin\GacUtil.exe"

# un-install the old version of the assembly
Gacutil /u "DirectEnergy.OAM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b6a416a3e4d1c768"

# Install new version of the assembly
Gacutil /i "C:\mywork\scm\DirectEnergy.OAM\Development\R1\DirectEnergy.OAM\bin\Debug\DirectEnergy.OAM.dll"
Also, you could create a shortcut in your desktop with the following attribute:
Target: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "C:\mywork\ps\DirectEnergy.OAM\Deploy-DE_OAM_DLL.ps1"
Start In: C:\Windows\System32\WindowsPowerShell\v1.0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.