GACUTIL Batch File

Topics: Enterprise Library Core, General discussion
Mar 11, 2008 at 7:32 PM
For those who need it I created a simple batch file to register the EntLib 3.1:


@SETLOCAL

@CALL "%VS80COMNTOOLS%vsvars32.bat"

@REM GACUTIL the following files

gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.AppSettings.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Database.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Database.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Common.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.HostAdapter.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.UI.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.AzMan.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.AzMan.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cache.CachingStore.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cache.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll
gacutil -if .\bin\Microsoft.Practices.ObjectBuilder.dll


@ECHO ***
@ECHO ***
@ECHO *** YOU ARE FINISHED WITH REGISTERING ENTERPRISE LIBRARY 3.1
@ECHO ***

pause
May 20, 2008 at 6:02 PM

updated for Enterprise Library 4 and Visual Studio 2008

@SETLOCAL

@CALL "%VS90COMNTOOLS%vsvars32.bat"

@REM GACUTIL the following files

gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.AppSettings.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Database.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.Database.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Common.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.HostAdapter.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.Design.UI.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Logging.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.AzMan.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.AzMan.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cache.CachingStore.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cache.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Security.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Design.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.dll
gacutil -if .\bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll
gacutil -if .\bin\Microsoft.Practices.ObjectBuilder2.dll
gacutil -if .\bin\Microsoft.Practices.Unity.Configuration.dll
gacutil -if .\bin\Microsoft.Practices.Unity.dll
gacutil -if .\bin\Microsoft.Practices.Unity.StaticFactory.dll

@ECHO ***
@ECHO ***
@ECHO *** YOU ARE FINISHED WITH REGISTERING ENTERPRISE LIBRARY 4.0
@ECHO ***

pause

May 20, 2008 at 8:19 PM
Edited May 20, 2008 at 8:20 PM

Here's a PowerShell script that will put the EL4.0 (May 2008) DLL's into the GAC:

 

#Purpose: Put all the DLL's of the Microsoft Enterprise Library 4.0 May 2008 edition to the Global Assembly Cache
#
# one of the two next lines is required in order to run gacutil in a powershell script:
#Set-Alias -Name gacutil -Value $env:ProgramFiles'\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe'

 

Set-Alias -Name gacutil -Value $env:ProgramFiles'\Microsoft SDKs\Windows\V6.0A\bin\gacutil.exe'
# keep track of current directory location before we change
pushd

# change to where the EL4.0 DLL's are located

Set-Location -Path $env:ProgramFiles\'Microsoft Enterprise Library 4.0 - May 2008\Bin'

# place each one into the Global Assembly cache
foreach ( $file in Get-ChildItem -Filter "*.dll" )

    Write-Host $file.Name
    gacutil /nologo /i
$file.Name
}

 

# return to previous directory location

popd

 

 

 

 

 

Jun 16, 2008 at 7:51 AM
I tried the above script but m getting "Access Denied" error, even though i have administrative rights, i m using windows vista enterprise edition.
Jun 16, 2008 at 4:20 PM

Hi,

You need to run your shell as an admin. See http://support.microsoft.com/kb/922708 for details. Keep in mind that running a shell as admin will change the current directory to the system directory, so the batch files will not work if launched directly from the explorer with elevated privileges (the PowerShell script shouldn't have problems since the binaries folder is included in the script.) 

Fernando


ali_sofi wrote:
I tried the above script but m getting "Access Denied" error, even though i have administrative rights, i m using windows vista enterprise edition.



Jun 5, 2009 at 8:55 AM

I don't understand why you would want to GAC the Design assemblies.  Aren't they only used with the Enterprise Library Configuration tool?

Jun 5, 2009 at 11:20 AM

Right-click on the Windows PowerShell short-cut and "Run as Administrator" or bring up the short-cut and set the "Run as Administrator" option permanently.  I prefer the later technique but to each his own.

Apr 11, 2012 at 10:15 PM

Here is the list for Ent Lib 5.0

 

GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Validation.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Caching.Database.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Common.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides.dll"     
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Data.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll"   
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll"   
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Logging.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.dll" 
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Security.AzMan.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Security.Cache.CachingStore.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Security.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WPF.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.ServiceLocation.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.Unity.Configuration.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.Unity.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.Unity.Interception.Configuration.dll"
GacUtil.exe /i "C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\Microsoft.Practices.Unity.Interception.dll"