Using EntLib with BizTalk.

1) Create a new c# project and add all the necessary entlib dlls that you need. (this will help because we would not be adding references to entlib dlls for every biztalk project.

2) Create static wrappers classes for say Exception handling

  Policy- is the name that you give when you configure the Exception handling block.

public static class Helpers

        public static void LogException(string policy, Exception ex)
            ExceptionPolicy.HandleException(ex, policy);


3) Add  a reference to the above project in the biztalk project and invoke it as if you are invoking any other .net method

4) Create app.config file using the EntLib tool say BizTalkEnlib.config

5) Modify the BTSNTSvc.exe.config to include the following section right under the configuration node
    <section name=”enterpriseLibrary.ConfigurationSource” type=”Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

6)Include the following right before the close of the configuration node

 <enterpriseLibrary.ConfigurationSource selectedSource=”File Configuration Source”>
      <add name=”File Configuration Source” type=”Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35″
        filePath=”C:\Program Files (x86)\Microsoft BizTalk Server 2009\BizTalkEntLib.config” />

thats it and you are all set to go!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: