path = "E:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\"
gacutil.exe /if "$(TargetPath)"
copy "$(ProjectDir)\app.config" "C:\WINDOWS\ASSEMBLY\GAC_MSIL\$(TargetName)\[ASSEMBLY_VERSION]__[ASSEMBLY_PUBLIC_TOKEN]\$(TargetFileName).config"
- Note that you have to replace some things in the code -[ASSEMBLY_VERSION] and ]__[ASSEMBLY_PUBLIC_TOKEN]
- Note that I have a configuration file called "app.config" that I am copying into the GAC after deploying the dll.
Also note that I have my "RecycleAppPools.vbs" file in the .net sdk bin folder. This script recycles all application pools automatically, and takes less time than an IISReset.
To create this file, create a new text file in the bin folder and paste the following code (rename the file to "RecycleAppPools.vbs"):
Set locator = CreateObject("WbemScripting.SWbemLocator") Set Service = locator.connectserver(strServer, "root/MicrosoftIISv2") Set APCollection = Service.InstancesOf("IISApplicationPool") For Each APInstance In APCollection APInstance.Recycle Next
All was well and good, but suddenly I began to get errors - the GAC wouldnt let me install the DLL and would tell me 'access denied' when I tried to delete it from the GAC or replace it.
After some internet research I found the solution - stop the indexing service.
Now my little script is running smoothly, and I am developing and debugging my event handler with no problems.
Oh, yeah - I wrote a small application to register the event handler to a list. Anyone interested? I can publish it - it supports both command line operation, and a GUI interface.