ESB Toolkit overrides BizTalk config (BTSNTSvc.exe.config)

I’ve setup a BizTalk Server 2013 environment with ESB Toolkit 2.2 and since I use Enterprise Library for logging I also updated the BTSNTSvc64.exe.config file, but when I tried to run a sample application it throws an error:

Activation error occured while trying to get instance of type LogWriter, key “”:Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type LogWriter, key “” —> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = “Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter”, name = “(none)”.

Exception occurred while: while resolving.

Exception is: InvalidOperationException – The type LogWriter cannot be constructed. You must configure the container to supply this value.

Apparently, ESBToolkit is overriding the BizTalk configuration.

Solution:

Move the configuration to \esb.config file.

ESB Toolkit 2.1 using Enterprise Library 5.0

If you’re here probably you have a problem about this error:

[A]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection. Type A originates from ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\4.1.0.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll’. Type B originates from ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\5.0.505.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll’

Now there’s been lot of discussion how ESB Toolkit 2.1 breaks all other application that uses Enterprise Library 5.0 when deployed on the same machine, that’s because it updates the machine.config, which is the mother of all configs.

As of this moment there’s no fix regarding this matter. To undo the error that ESB Toolkit causes (see error above) you can follow the steps below:

Solution:

Step 1. You need to check the platform that your application targets, either 32bit or 64bit and the .NET Version. For BizTalk 2010 it’s 4.0. 

To check the Host whether it’s using 32bit (default) or 64bit explicitly. BizTalk Admin Console -> Platform Settings -> Hosts -> -> Properties -> Options -> 32-bit only flag.

Step 2. After determining the target platform,  open the Notepad.exe (Run as Administrator). It’s important to run it as administrator as we are going to edit the machine.config.

Step 3. Based on the platform open the machine.config using the Notepad.

32-bit: %Windows%\Microsoft.NET\Framework\v4.0.30319\Config

64-bit: %Windows%\Microsoft.NET\Framework64\v4.0.30319\Config

Step 4. Comment or remove the following sections:

Step 5. Save and restart the application/services/host instances.

EsbToolkit 2.1 – Installation and Configuration Errors (Compilation)

I recently installed BizTalk Server 2010 and EsbToolKit 2.1 and below are the summary of errors and instructions on how to overcome them.

Error:

HTTP Error 404.17 – Not Found
The requested content appears to be script and will not be served by the static file handler.

Resolution:

Be sure that .NET 4.0 is installed, then run the following:  aspnet_regiis -i  in C:\Windows\Microsoft.NET\Framework\v4.0.21006

Error:

HTTP Error 404.2 – Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

Resolution:

1. Go to Internet Information Services (IIS) Manager, click the {YouComputerName} Home (located  after the Start Page icon).

2. in the IIS Section -> Double click ISAPI and CGI Restrictions -> make sure ASP.NET is allowed.

Error:

HTTPException, Could not load file or assembly ‘System.Web.DataVisualization…

Resolution:

1. Download and install Microsoft Chart Controls for .NET 3.5

 Error:

Could not enlist send port ‘ALL.Exceptions’ in Microsoft.Practices.ESB application (BizTalk Admin Console)

Resolution:

Add new filter expression to it, Property: ErrorReport.FailureCode Operator: Exists

 

Error:

HttpException, Could not load type ‘Microsoft.Practices.ESB.Portal.Global’.  

Resolution:

In the ESB Toolkit installation manual there’s no mention of Enterprise Library but in fact you need to install it. Also, ESB Toolkit uses Enterprise Library 4.1 and not 5.0. Get the installer here. Then rerun the Management_Install.cmd.

Error:

WebException,  The remote server returned an error: (401) Unauthorized. 

Resolution:

1. Click Start, click Run, type cmd, and then press ENTER.

2. Locate the directory that contains the Adsutil.vbs file. By default, this directory is C:\Inetpub\Adminscripts.

3. Type cscript adsutil.vbs set w3svc/1/root/NTAuthenticationProviders “Negotiate,NTLM”

 The number after w3svc is the website id, the script above assumes that the ESBPortal is your first website.

For the complete Microsoft Guide click here.

 

Error:

WebException,  The remote server returned an error: (404 ) not found.  

Resolution:

.svc should be register in IIS, run the following command in command prompt.

“%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe” -r -y

Error:

Runtime Error, Client found response content type of  ‘text/html; charset=utf-8’, but expected ‘text/xml’

Resolution:

Problem lies with ESB.BizTalkOperationsService, by going to the web.Config of this service then setting customErrors mode to “RemoteOnly”, you can see the actual error which is: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel’. 

This error could occur if IIS is installed only after installing .NET 4.0. To solve this type the ff: in command prompt:

%WinDir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -iru

 

Error:

Management_Install.ps1 cannot be loaded because the execution of scripts is disabled on this system.

Resolution:

Open Powershell Command Prompt (Run as Administrator). Type  Set-ExecutionPolicy Unrestricted