Programmatically remove BiztalkAssembly resource from an Application

September 3rd, 2008 by Marcel

Here is a short C# code snippet about how to remove a BizTalk assembly resource from a BizTalk application.

To use this code you have to add BizTalk.Application.Deployment.Engine.dll (located in the BizTalk installation folder) and Microsoft.BizTalk.Admin.dll (located in the GAC) as reference.

public static void RemoveAssemblyResource(
   string pAssemblyDisplayName,
   string pApplicationName,
   string pServerName,
   string pMgmtDatabase)
{
   Microsoft.BizTalk.ApplicationDeployment.Group lDepGroup =
      new Microsoft.BizTalk.ApplicationDeployment.Group();

   try
   {
      lDepGroup.DBName = pMgmtDatabase;
      lDepGroup.DBServer = pServerName;

      Microsoft.BizTalk.ApplicationDeployment.Application lApp =
         lDepGroup.Applications[pApplicationName];

      if (lApp.IsSystem)
         throw new Exception(”System applications can not be changed!”);

      lApp.ResourceCollection.Remove(string.Empty, pAssemblyDisplayName);
   }
   catch
   {
      lDepGroup.Abort();
      throw;
   }
   finally
   {
      lDepGroup.Dispose();
   }
}

Posted in Biztalk, Development |

One Response

  1. Websites tagged "biztalk" on Postsaver Says:

    [...] - Programmatically remove BiztalkAssembly resource from an Application saved by GuyGadois2008-09-23 - BizTalk 2006: Generate Schemas (XSD) from XML files saved by [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Recent Posts

Tags

Calendar

September 2008
M T W T F S S
« Jun    
1234567
891011121314
15161718192021
22232425262728
2930  

PocketPC

Categories