Yet another

When compiling an orchestration I get an error saying .

Error1illegal use of identifier '' in an expression wher the '' have some value. 

This is actually me setting an initial value for a a string variable. You need to put the initial value in "initialValue" quotemarks

I had forgotten this, so i spent some time rememering/trying different stuff and document it here so you dont have to,

BizTalk Host "Stop Pending"

When restarting a BizTalk host I experiences that it would not restart. The service was stuck in a "Stop Pending" state. It seem that the only way to get the host back up, is to terminate the process and the start it.
When i tried to restart fro BizTalk Administration Console nothing happen. I had to user the End Task function in Task Manager
To get the correct instance i needed to find the correct instance. The only way to be sure to get the right one is to find the Process ID (PID)
This might be found by using the command prompt using

tasklist /SVC /fi "imagename eq btsntsvc.exe"

This will list all BizTalk hosts like this
Image Name              PID  Services
============= ================================
BTSNTSvc.exe            2376 BTSSvc$Rcv_x32_1_FTP_H
BTSNTSvc.exe            2396 BTSSvc$Rcv_x32_1_JNBridge_H_ActiveMQ
BTSNTSvc.exe            2416 BTSSvc$Rcv_x32_1_JNBridge_H_OracleAQ
BTSNTSvc.exe            2436 BTSSvc$Rcv_x32_1_Random_H
BTSNTSvc.exe            2588 …

Using the BAM API to write BAM events from orchestrations

One of the easiest ways to update a bam activity from an orchestration is to use the BAM API, Simply add reference to

Microsoft.BizTalk.Bam.EventObservartionMicrosoft.BizTalk.Bam.XLANGs to your project and you are ready to start.
In the basic level you have to start, update and end an activity.

Start Activity I reccomend creating variables for activity name and instanceID, To avoid any confutions. The Activity name must match the Activity name created and deployed using bm.exe. (I will create a seperate post for this)

The code in start-bam-expression-shape in orchestration PreProcessInvoice will then look something like this:

activityName = ("ProcessInvoice");//this is the activity we are loading data into
activityInstance = System.Convert.ToString(System.Guid.NewGuid())+"PreProcessInvoice"; //if bamming to same activity from different orchestration, we may track where the data is comming from by adding orchestration name.


Adding BAM add-in in Excel

If you need to add the BAM add-in to excel there are a few simple steps to follow.

Open the option section in excel

Go to the Add-Ins pane and click the Manage Add-Ins button
Brows to the addin file C:\Program Files\Microsoft BizTalk Server 2013 R2\ExcelDir\Bam.xla and press ok.

Then you have the BAM add-ins ready for use in excel

BizTalk SendPort Macros

Today I needed to get an onverview of what macros that are available out-of-the-box wend sending a message to a filebased destination. These should work for FILE and FTP adapter.

%datetime% : Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, 1997-07-12T103508)%datetime_bts2000% : UTC date time in the format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds) : Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).%DestinationParty% : Name of the destination party. The value comes from message the context property BTS.DestinationParty.%DestinationPartyID% : Identifier of the destination party (GUID). The value comes from the message context property BTS.DestinationPartyID.%DestinationPartyQualifier% : Qualifier of the destination party. The value comes from the message context property BTS.Des…

Undo checkout of another user in tfs

Here is a familiar scenario:
someone does a checkout from a computer and forgets to check in. The computer is removed from network or the use is take off the project. Anyhow you end up with a file that is checked out to a resource no longer available.
Luckily there is a commandline option if you are an admin in the tfs server i questions.

The commandline :
tf.exe undo /workspace:workspacename;owner "$/xxx/Code/References" /server:servername/noprompt

A real world example would be:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>tf undo /workspace:PC-750328
;eriei$/BizTalk/Utility/Library/Main/Utility.Library/MessageContext.cs /server

The output form this is:
The operation completed successfully.  Because the workspace PC-750328;Andreas H
jelle is not on this computer, you must perform a separate get operation in that
 workspace to update it with the changes that have been made on the server.

The Messaging Engine failed to register an adapter "WCF-BasicHttp". Details: "Registering multiple adapter types within the same process is not a supported configuration. For e.g. HTTP and SOAP receive adapters cannot co-exist in the same process

When deploying a wcf service to biztalk the is a good chance you will run into:

The Messaging Engine failed to register an adapter "WCF-BasicHttp". Details: "Registering multiple adapter types within the same process is not a supported configuration. For e.g. HTTP and SOAP receive adapters cannot co-exist in the same process"

When installting a SOAPm HTTP or WCF service on the same WebServer then seperate app pools must be created for each adapter. Using seperat app pools will solve the issue. Note the this is only a problem om win servers as desktop version of windows does not have an app pool concept.