c# - Deploy multiple dll files into gac without gacutil -
So, I have several C # DLs which have to be deployed on many machines in GAC. It's not not gacutil and I like if he's on that path. How can it easily go about deploying these files, such as just running an XE or batch file? What is a good idea to make executable file for GAC deployment and how can it be done? Ps. I have only MS Visual Studio Express PowerShell is your friend: < Code> Function Gac-Util {param ([parameter (mandatory = true)] [string] $ assembly) {$ error Try Clear () [Reflection.Assembly] :: LoadWithPartialName ("System.EnterpriseServices"). Outstanding [System.EnterpriseServices.Internal.Publish] $ publish = New-Object System.EnterpriseServices.Internal.Publish (! (Assembly assembly assembly type test-path)) {"assembly $ assembly does not exist"} If ([System.Reflection.Assembly] :: LoadFile ($ Assembly) .GetName (). GetPublicKey (). Length -Ek 0) {Publish $ "Assembly $ should be strongly signed"} Write GacInstall ($ Assembly) - Host "` T $ $ ($ MyInvocation.InvocationName): Assembly $ assembly gacced "} hold {write-host" `t $ $ $ ($ MyInvocation.InvocationName): $ _"}} < / Code>
Comments
Post a Comment