Postbuild technique to perform various operations including adding assembly in Global Assembly Cache

Using the command line options for "Post-Build" events you can execute any type of DOS commands which could perform different operations.

Create/Open a project in Microsoft Visual Studio.

Add a new file "PostBuild.bat".

Add following commands in it

In Project Properties, go to Build Events.

In "Post-build Event Command Line" add following command to execute your file which is:

"$(ProjectDir)"postbuild.bat

Postbuild.bat contents can be:

rem -- set environment specific variables

set projPath=C:\MyProject

set pdbFilePath=d:\MyProject\bin\debug\Edwards.Moss.Web.Common.pdb

set appPoolName="DefaultAppPool"


 

rem -- copy assembly and debug database

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i %projPath%\bin\Debug\MyProject.dll /f

copy %projPath%\bin\Debug\MyProject.pdb "C:\WINDOWS\assembly\GAC_MSIL\MyProject\1.0.0.0__g530125dghad5ac3\MyProject.pdb"

iisapp.vbs /a %appPoolName% /r

Comments

Popular posts from this blog

Unable to delete Shared Services Provider in SharePoint (MOSS)

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Cannot add a SimpleContent column to a table containing element columns or nested relations