How do we do this?
1.- Open the properties window for your project... solution explorer> right click project name > select properties.
2.- Click "Build Events".
3.- Paste
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" -i "$(TargetPath)" } C:\Recycle.vbs
in to the "Post-build event command line" field.
4.- Create a new text file with the following script:
strAppPoolName = "Sharepoint - 80"
strComputer = "."
Set objWMIService = GetObject("winmgmts:{authenticationLevel=pktPrivacy}\\"& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * From IIsApplicationPool Where Name = 'W3SVC/AppPools/" & strAppPoolName & "'")
For Each objItem in colItems
objItem.Recycle
Next
Wscript.echo "Recycle Completed"
5.- Save as C:\Recycle.vbs
Thanks. I used to develop dll in Vb, not try .net yet.
ReplyDeleteI'll give it a try.
thanks again.