Deploy assembly programmatically

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Deploy assembly programmatically

Viewing 2 reply threads
  • Author
    Posts
    • #18754

      In BizTalk 2004 i have used WMI (MSBTS_DeploymentService) to deploy my BizTalk assemblies programmatically. Writing something like this in c#:

      ManagementPath managePath = new ManagementPath(“ROOT\\MicrosoftBizTalkServer:MSBTS_DeploymentService”);
      ManagementClass deployService = new ManagementClass(managePath);
      ManagementBaseObject deployBase = deployService.GetMethodParameters(“Deploy”);
      object[] methodArgs = { server, database, assemblyPath, install, bindingFilePath, logFilePath };
      deployService.InvokeMethod(“Deploy”, methodArgs);

      This also works in BizTalk 2006 / BizTalk 2006 R2. But the assemblies are deployed in the standard application (BizTalk Application 1). I want to define which application the assemblies are deployed to. Is this possible using wmi, or is there another way to deploy assemblies programmativally?

      thanks in advance 

       

       

       

    • #18760

      I think in BizTalk 06 that introduced BTSTask command line tool.  That would probably be a better way to go and it supports BizTalk Applications.  You can find more info on that inside the help guide. 

      It’s really straight forward and you can use .bat scripts to call it. 

       

      • #18786

        The reason why i want to perform application tasks programmatically is that i also need to start my application and doing other tasks not available in btstask.exe. This can be done using the ExplorerOM api.

        I have created a setup project to GAC my assemblies, and with a installer class as custom action i perform application tasks. Since i have found no better way to deploy assemblies than using BTSTask as you recommend, i call btstask.exe from my installer class, writing someething like this:

         Process p = new Process();

        p.StartInfo = new ProcessStartInfo(“btstask.exe”, “AddResource -ApplicationName:” + application + ” -Type:System.BizTalk:BizTalkAssembly -Source:\”” + assemblyPath + “\” -Destination:\”” + assemblyPath + “\””);

        p.Start();
        p.WaitForExit();

        It works!

    • #18793

      Hi,

      We can create new application name using BTSTask and see the sample below

      BTSTask AddApp -ApplicationName:BizSampleApplication

      if you want to deploy assembly programmatically, use create .bat file with BTSTask command line tool.

      Bye

      Kannan Nova

      • #18805

        But the only way i have found to start an application programmatically is using the ExplorerOM api.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.