When BizTalk uses a multi-server deployment scheme, if you want to updateProgramYou must update the Assembly to the GAC of multiple servers at the same time. It is too troublesome to manually update multiple servers after each update. To be lazy, you can use WMI to create a process on the remote server to update the assembly in the GAC :)
Run the following command to create a process on a remote server Using WMI:
WMIC/node: server01/User: mydomain \ myusername/password: Pass @ word1 process call create "C: \ gacutil/u mybizassembly"
WMIC/node: server01/User: mydomain \ myusername/password: Pass @ word1 process call create "C: \ gacutil/I c: \ deploy \ mybizassembly. dll"
The next step is to copy the Assembly from the build machine to the deploy server, then call gacutil to uninstall the Assembly, reinstall the assembly, and restart BizTalk host instances. You can write all the commands to a batch file:
@ Echo Copy files
Copy c: \ build \ mybizassembly. dll \ server01 \ deploy \ mybizassembly. dll
Copy c: \ build \ mybizassembly. dll \ server02 \ deploy \ mybizassembly. dll
Copy c: \ build \ mybizassembly. dll \ server03 \ deploy \ mybizassembly. dll
@ Echo Install assemblies To GAC
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"
WMIC / Node: server03 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server03 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"
@ Echo Restart host instances
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalkreceivehost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalkreceivehost"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalkprocesshost"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalkprocesshost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalksendhost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalksendhost"
However, this method is only applicable when the bindings of BizTalk is not affected. For example, if the new assembly is replaced by the original assembly with an exteneport, this method cannot update the bindings of BizTalk.
This method also applies to deploying the assembly to the test server after daily build. You only need to add a custom task.
< Target Name = "Aftercompile" >
< Exec Command = "& Quot; C: \ mywmideploy. BAT & quot ;" />
</ Target >