Creating new HOSTS and HostInstances

Topics: General Questions
Dec 1, 2010 at 4:04 PM
Edited Dec 2, 2010 at 5:08 AM

Hi Thomas,

First let me cogratulate you for BTDF.

I would like to create a BizTalk Host (mentioned in the btdfproj) in case it is already not present.

Would it be possible in the latest release ?

If not, then could you please guide in simple steps to run a preprocessing script (typically a .bat or a .exe file) that would do the job of creating the Hosts and Hostinstances and their respective mappings etc in my case  via btdfproj.

I am using BizTalk 2010.

Thanks,

Avinandan Patra

Coordinator
Dec 1, 2010 at 6:33 PM

Thanks Avinandan!  There is nothing built in to create or modify hosts or host instances.  However, you can script the configuration using WMI through VBScript, C#, PowerShell or your preference.  Here are the samples for VBScript and C#: http://msdn.microsoft.com/en-us/library/aa561208(v=BTS.70).aspx.

Once you have a working script, you can call it from your deployment inside a Target named CustomDeployTarget in your .btdfproj (see other posts here about CustomDeployTarget).  Or, you can simply call your script separately from the deployment.  I have never tried changing the list of hosts during execution of a deployment script, so I'm not sure if CustomDeployTarget will be called early enough to avoid errors.

Thanks,
Tom

Dec 2, 2010 at 1:39 PM

Thanks for the quick reply Tom.

I have read various posts regarding CustomDeployTarget.

Could you please provide the various commands/Tasks (with sample code or syntax) that could be used here.
So far I have got the below two commands.

1. Exec Command
    <Target Name="CustomDeployTarget">
        <Exec Command="regedit /S somefile.reg"></Exec>
    </Target>

2. Copy Command
    <Target Name="CustomDeployTarget">
        <Copy SourceFiles="ABC_Folder\xyz.xml" DestinationFolder="DEF_Folder" ></Copy>
    </Target>

I haven't tried the CustomDeployTarget yet, I am currently creating a exe file calling the relevant WMI methods to create the hosts.
I just need the correct command that could invoke this exe file.

 

Thanks in advance.
Avinandan Patra

 


 

Coordinator
Dec 2, 2010 at 3:34 PM

If you just need to call your .EXE from the CustomDeployTarget target, then you'll use an Exec task like #1.  Here's the documentation for the built in tasks in MSBuild 4.0: http://msdn.microsoft.com/en-us/library/7z253716(v=VS.100).aspx.

Your EXE path reference in the Exec task should be relative to the Deployment project folder.  If you put the EXE in <solutionroot>\Helpers, the path would be ..\Helpers\Your.exe.  Remember to include your helper EXE in the MSI by adding an ItemGroup with the AdditionalFiles element.

Thanks,
Tom