mo.notono.us

Tuesday, June 26, 2007

Generic Batch File to GAC Assembly DLLs and PDBs

::----------------------------------------------------------------------------
:: GACs assemblies located in the Assemblies folder - these have been stuck 
:: there by the following post-build event script on each individual project:
::	copy "$(TargetPath)" "$(SolutionDir)\Assemblies\$(ConfigurationName)\"
::	copy $(TargetDir)$(TargetName).pdb "$(SolutionDir)\Assemblies\$(ConfigurationName)
::----------------------------------------------------------------------------
@ECHO OFF

:: Temporarily navigate to the Assemblies folder
PUSHD C:\Projects\YOURPROJECT\Assemblies\Debug

:: Call the GacAssembly subroutine once for each assembly
CALL :GacAssembly YOURPROJECT.BusinessLogic
CALL :GacAssembly YOURPROJECT.DataAccess
CALL :GacAssembly YOURPROJECT.Interfaces
CALL :GacAssembly YOURPROJECT.ServiceImplementation


ECHO Recycle the "YOURAPPPOOLNAME IIS Application Pool
%windir%\system32\cscript.exe c:\windows\system32\iisapp.vbs /a YOURAPPPOOLNAME /r

POPD
PAUSE
GOTO:EOF

::----------------------------------------------------------------------------
:GacAssembly
ECHO -------------------------------------------------------------------------
ECHO GACing the %1 assembly and its PDB file
ECHO -------------------------------------------------------------------------
ECHO.
@"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" /u %1
@"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" /i %1.dll
copy %1.pdb "C:\WINDOWS\assembly\GAC_MSIL\%1\1.0.0.0__YOURPUBLICKEY\"
ECHO.
GOTO:EOF

Labels: ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home