Error: No snaps-ins have been registered for Windows PowerShell

You run the following:

Add-PSSnapIn -Name BiztalkFactory.PowerShell.Extensions  #NOTE: Must be in 32-bit version of Powershellto use this SnapIn


And you get this error:

Add-PSSnapIn : No snap-ins have been registered for Windows PowerShell version 3.


Solution:Go the SDK/Utilities/Powershell and install them

Basically follow the steps laid out by here MSDN BizTalk Forum, except you don’t need to download from CodePlex, you can use the one in the install.

  1. Navigate to: C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\SDK\Utilities\PowerShell
  2. Optionally open and follow the readme.txt
  3. Open a command prompt as an administrator
  4. Change directory to the folder containing the binaries – \SDK\Utilities\PowerShell under the base install location
  5. Run the following command to install/register the dlls
    %windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe .\BizTalkFactory.PowerShell.Extensions.dll

I needed this today to run a powershell to create biztalk hosts.

The following may help with a variety of custom pipeline component issues, including why your “Debug” is not catching when you expect it to. There were times today, where I would do “Debug Attach” to the BizTalk Host Instance, and the component would never go into debug mode.

1. Check that date/time of the .DLL in the GAC. There’s a chance you compiled it and though you GAC’ed it but it didn’t. Here’s the folder name to check:


You might be using a Post Build Event like this to GAC the .DLL:

which is placed in the project properties dialog as shown below:

Check your View/Output in Visual Studio to see if you have message that it did or didn’t GAC successfully:

Example Successful GAC
1>  Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
1>  Copyright (c) Microsoft Corporation.  All rights reserved.
1>  Assembly successfully added to the cache
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Example Failed GAC
1>  Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
1>  Copyright (c) Microsoft Corporation.  All rights reserved.
1>  Failure adding assembly to the cache:   The process cannot access the file because it is being used by another process.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "CALL "%VS140COMNTOOLS%vsvars32.bat"
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: gacutil.exe /i "C:\Users\nrwalters\Documents\Visual Studio 2015\Projects\ABC.Common\ABC.Common.BizTalkPipelineComponentEmail\bin\Debug\ABC.Common.BizTalkPipelineComponentEmail.dll"" exited with code 1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

Sometimes you have to close Visual Studio, then re-open it and do the ReBuild.
Once I was just doing “Build” and since the code didn’t change, it wasn’t rebuilding, and thus it wasn’t running the Post-Build Event, and thus the GAC didn’t get changed!

Other Steps

2. Always restart your host instance. If you have more than one, make sure you picked the right one.

3. When you do Debug Attach – you also have to make sure you select the proper BTNTSvc.exe. Use Task Manager to get the process ID based on the name, and then in Visual Studio, select based on the “ID” column.

Pipeline Components Directory?

Some blogs say that since BT 2006 this isn’t really needed; that you should just GAC your pipeline components.
Other people argue that it is still necessary. I seem to have success with the first otpion.


The adapter failed to transmit message going to send port “sp_Test_SFTP” with URL “s”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.IO.FileLoadException: Could not load file or assembly ‘WinSCPnet, Version=, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)
File name: ‘WinSCPnet, Version=, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’ —> System.Exception: SFTP adapter requires WinSCP to be installed. Please refer . —> System.IO.FileNotFoundException: Could not load file or assembly ‘file:///C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.BizTalk.Adapter.Sftp\v4.0_3.0.1.0__31bf3856ad364e35\WinSCPnet.dll’ or one of its dependencies. The system cannot find the file specified.


I think BizTalk requires a specific older version of WinSCP and you can’t just download the latest one.
This error could also occur if you didn’t copy the file to the proper directly.

I found Michael Stephenson’s BizTalk 2016 SFTP blog, and it had a nice PowerShell script.

I just had to
1) Change directory names (I had a Software directory similar to him, but I had to create a WinSCP subdirectory under it)
2) Then PowerShell with the “Run as Admin” option.

Then the script ran fine, I restarted BizTalk Host Instance, and it got past this error, on to other errors that I’ll blog about in the near future.

By the way, I was able to run in a 64-bit host with no problem.  I remember that in older version of BizTalk the FTP adapter ran only in 32-bit hosts.




I started with this excellent working unzip pipeline component here (by Rui Machado).

I made the following changes to that code:
1) Put it in MyCompany.Common.etc… namespace and project (not shown here)
2) Added a Property Bag Item called FileMask (and a one for future use called “ParmReserved1” (this is standard coding, so I didn’t include here).
3) Added the FitsMask function from StackOverflow
4) Added the functionality to set the %SourceFileName% (aka ReceivedFileName, based on the files inside the zip instead of the zip file dropped).

public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
  IBaseMessage Temp = inmsg;
  // uses Ionic.Zip 
  using (ZipFile zip = ZipFile.Read(inmsg.BodyPart.GetOriginalDataStream()))
    foreach (ZipEntry e in zip)
      string strCheckFileName = System.IO.Path.GetFileName(e.FileName);

      if (FitsMask(strCheckFileName, FileMask))
         var ms = new MemoryStream();
         IBaseMessage outMsg;
         outMsg = pc.GetMessageFactory().CreateMessage();
         outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
         outMsg.Context = inmsg.Context;

        // Neal Walters - 05/08/2017 - added promoted field with the filename - 
        // This allows us to use the %sourcefilenam% macro in the SendPort to name the file. 

        string XMLMessage = Encoding.UTF8.GetString(ms.ToArray());

        MemoryStream mstemp = new System.IO.MemoryStream(

        outMsg.GetPart("Body").Data = mstemp;


        private static bool FitsMask(string fileName, string fileMask)
            string pattern =
                 '^' +
                 Regex.Escape(fileMask.Replace(".", "__DOT__")
                                 .Replace("*", "__STAR__")
                                 .Replace("?", "__QM__"))
                     .Replace("__DOT__", "[.]")
                     .Replace("__STAR__", ".*")
                     .Replace("__QM__", ".")
                 + '$';
            return new Regex(pattern, RegexOptions.IgnoreCase).IsMatch(fileName);

The screen shot below show how the FileMask can be specified in the RecieveLocation (via use of the standard Property Bag interface):

(Sorry, don't have SnagIt yet at this client, so have to use the poor man's Snipping Tool).

It seems to me that Microsoft hides the links to these forums.  You can find them on the Microsoft site, but they are buried under a drop-down list with about 100 other forums.

You can ask questions and get answers in the forums below on the MSDN site (  You can also get good answers in

Some people are still using the forums at BizTalk Gurus:


BizTalk Geenral:


BizTalk EDI:


Adapters and Adapter Pack:


BizTalk RFID:


BizTalk ESB Toolkit:

You can post a new question/issue to the MSDN Community Forum here:

When you select “BizTalk Server” fro the “Forum category”, you will then get the list of specific BizTalk Forums on the right, as shown below:



Suppose you need to create an EDI file with the ISA header that looks like this:

You need put “ZZ” in the ISA05 field, and “ABCDEFGPLUMBING” in the ISA06 field. How do you do that in BizTalk?

In the Trading Partner Management (TPM) of the BizTalk Admin Console,
when you set up a “party”, you can specify the identifiers. For the “ZZ” identiier, select “Mutually Defined (X12)” from the drop down list under the “Name” column, and specify “ZZ’ as the qualifier, and type in the value “ABCDEFGPLUMBING” or whatever the desired value is in the “Value” column.

The ISA and GS headers will NOT be in your BizTalk map.  They will be generated when you use the EDI Pipeline to read or write a file in a send or receive port.


I’m creating my own checklist of things to watch out for on a BizTalk install, beyond the basic BizTalk hardware/software prerequisites.

Sites below are for BizTalk 2010 – but same applies for most any other release: – List of Active Domain (AD) groups and service accounts.
I took this, put it in MS/Word and added a column to the left with a suggested name for the client.  Then I asked the client to verify my suggest name to fit their existing AD group/account naming conventions.  I included an “X” for each environment, e.g. (D=DEV, T=Test, Q=QA, P=Prod), or a 3-character (DEV, TST, QUA, PRD).   Example, BTSPRDADMINS (or if you like mixed case, BtsPrdAdmins).  Windows Configuration Checklist –
– turn off hyperthreading,
– Ensure Windows Server processor scheduling is set to “Background services”
– Place the Windows paging file on a separate local physical drive.
– Stop real-time virus scanning of database files and .xml, .csv, etc… – IIS Configuration Checklist – – SQL Configuration Checklist
  – enable Trace Flag 1118 (TF1118) – to reduce contention
  – sp_configure ‘Max Server memory (MB)’,(max size in MB)sp_configure ‘Min Server memory (MB)’,(min size in MB)
 – Autogrow to fixed MB not % for BizTalk DBs  – SQL Server Settings that Should Not Be Changd

1) Max Degree of Parallelism (MDOP) is set to “1” during the configuration of BizTalk Server for the SQL Server instance(s) that host the BizTalk Server MessageBox database(s). This is a SQL Server instance-level setting. This setting should not be changed from the value of “1”. Changing this to anything other than “1” can have a significant negative impact on the BizTalk Server stored procedures and performance. If changing the parallelism setting for an instance of SQL Server will have an adverse effect on other database applications that are being executed on the SQL Server instance, you should create a separate instance of SQL Server dedicated to hosting the BizTalk Server databases.

2) Auto create statistics and auto update statistics are turned off for the BizTalk MessageBox DB. 
zTalk Server stored procedures have exact joins and lock hints specified on the queries. This is done to ensure that the optimal query plan is used by the BizTalk Server queries in SQL Server. The distributions and expected results for the queries are known; the approximate number of rows returned is known. Statistics are generally not needed.

3)  BizTalk Server does not support defragmenting indexes. “DBCC INDEXDEFRAG” and “ALTER INDEX … REORGANIZE …” are not supported since they use page locking, which can cause blocking and deadlocks with BizTalk Server. BizTalk Server does support database index rebuilds (“DBCC DBREINDEX” and “ALTER INDEX … REBUILD …”), but they should only be done during maintenance windows when BizTalk Server is not processing data. Index rebuilds while BizTalk Server is processing data are not supported.

Index fragmentation is not as much of a performance issue for BizTalk Server as it would be for a DSS system or an OLTP system that performs index scans. BizTalk Server does very selective queries and updates and BizTalk Server stored procedures should not cause table or index scans.  – What you can and cannot do with the MessageBox Database

The next very, very important thing to understand is that while the database is installed on your server, it is not “your” database. It is our (or if you catch me on the wrong day, not thinking, “my”) database

A quick list of things which can effect the query plans:

– Statistics (don’t enable these)

– Parallelism (don’t turn this on )

– Table structure (don’t add indexes, columns, triggers, … If you do you will hear silence when you call for help)

– Stored procedures (don’t change them. You can look all you want, but no touching)

I had the following chat via a Microsoft Chat/Sales guy today.

Microsoft Answer: In order to have access to BizTalk Server 2016 you’d need VS 2017 Enterprise with MSDN or the MSDN Platforms subscription. I can help you get in contact with a Microsoft Reseller to provide you or your client a quote to purchase this product, would this work?

Neal Question: And can you confirm this… If admin installs BizTalk, but then two developers use the system on a regular basis, would we need just 2 MSDN licenses? or does the Admin need one for a total of 3?

Microsoft Answer: You would need a total of 3. Visual Studio and MSDN are licensed in a Per User basis, so each user would need his/her own license/subscription.

Neal Question: Ok, so by just have the developer install it instead of the Admin, we save a whole license? That doesn’t make a lot of sense.

Microsoft Answer: Each user that needs access to Visual Studio, MSDN or any component like software downloaded, would need his/her own license/subscription. Does this make sense?

Visual Studio Subscription (formerly MSDN) Prices as of March 2017

Buy   $1199   $5999
Renew    $799   $2569

The Professional “Standard” includes one CAL (Client Access License) to TFS (Team Foundation Server).

It looks like Microsoft has decided to phase out the term MSDN in favor of “Visual Studio Subscription”, but then, you still see (MSDN) in parentheses after some of the product.  They really like to muddle it up to be very confusing.  I think bottom line, they want you to talk to a sales rep.


For Visual Studio Pricing, they have a similar doc called: “Visual-Studio-2017-Licensing-Whitepaper-March-2017.pdf“.

Per Core Server Pricing for Production Environment

Branch Standard Enterprise
License   $620 per core   $2485 per core   $10835 per core

Everywhere that I’ve worked and consulted, the Enterprise edition is used.  The “branch” edition is a concept that you buy a cheap BizTalk server for customers or remote offices, and each one would have very limited processing, usually sending the data on to the main BizTalk server which would be the Enterprise edition. I’ve yet to actually work with anyone that uses this.

Source for pricing:

See also this article:

We all know that Microsoft is infamous for moving their links around, but as of today, you can download the “BizTalk Server 2013 R2 Licensing Datasheet and FAQ” from the linked title.  They don’t seem to have a similar document for BizTalk 2016 yet.

You have to have that document to see the side by side comparison grid of the different versions of BizTalk (Branch, Standard, Enterprise, and Developer).

The main difference between Standard and Enterprise, as it has been or many years, is that the Standard edition is limited to 8 cores, and it only allows 5 applications.  What is an application?  That’s a bigger question. Usually, it’s rather clear and ties to your development project.  Management wants to accomplish a project, they fund it, and you create an application to solve the issue.  But, who is to say you couldn’t put two “systems” in one “application”?
The other thing I’ve never found out for sure, if having a sixth application won’t work in the standard edition, or whether it is just a violation of your license. As I mentioned above, everywhere I’ve been, we have always used the Enterprise Edition.

The second difference is that Enterprise has more features for scale out, failover, and high availability (i.e. clustering). It allows you to have multiple message box databases, typically spread across different SQL servers, in order to spread the I/O load for heavy volume systems.  While I’ve used clustering in many sites, maybe only one site of the dozen I’ve worked, has split out a second message box database.

The developer license actually does everything that the Enterprise can do, and thus can be used in your dev and maybe QA environments.

The above PDF document also explains the “Per Core” license model, which is also explained in the article on the BizTalk 360 site above.


Follow-Up about the Admin License and “MSDN Platforms”

A few days later I learned about the MSDN Platforms subscription, so I returned to ask some more questions:

Neal Question: Hi, I was here the other day, and needed clarification on something. If we are installing BizTalk 2016, and let’s suppose an Admin installs it on a server, and the developer uses it regularly after that., he said we needed two licenses. But my question today is, could the admin use the MSDN Platform license?

Microsoft Answer: Hi, Neal, I’ll be glad to help you with your questions about MSDN licensing. Well, 2 people will need to use any software from the MSDN subscription, then, both would need to be licensed for it, unless the admin already has a license for BizTalk 2016, then, no additional licenses are required.

Neal Question: If we have BizTalk licensed for Prod, then does that qualify the admin to install it on Test servers? Or is MSDN needed for that?

Microsoft Answer: Well, if you have the license, you can use it for testing. But, your production license is only for one server, with MSDN you are able to install it as many times as needed, but, only the MSDN licensed users are allowed to use it.

Neal Question: Ok, so back to my original question – does the MSDN Platforms include BizTalk 2016?

Microsoft Answer: Let me look it up real quick for you. Eventually he came back and said it was included.

But bottom line, it’s hard to get a clear answer from even these licensing support guys.  They almost always ask you questions like “Have you talked to a sales rep”, or similar.

See also this good post on “MSDN Platforms (announced)“.  Link to Microsoft MSDN Platforms.


It’s long been said that a picture is worth a thousand words.  I think it’s necessary to have a few diagrams to show the BizTalk flow of any application. I’m not happy with UML, because they don’t show the many aspects of BizTalk.  I’ve walked into companies before that had no diagram, and the first thing I did was to create one.  In the process, I learned the flow of the system, and I document it for myself and others.  I often pin such diagrams to my cubicle or tape them to my office wall, and refer to them frequently.  They are constantly used in meetings to explain steps and processes to managers, users/customers, and/or other developers.

Ideally, the diagram should include:
1) Some key filenames (or at least partial filenames, as the paths are going to be different from development to QA to Production) 2) Key programs (orchestrations and any C# programs)
3) BizTalk Send/Receives
4) Any touchpoints with existing in-house systems or external trading partners (vendors, customers, etc…)

Here are some of the shapes and colors I’ve been using as part of standard Visio:
1) Light Yellow Parallelogram – Receive or Send Port – If relevant, I often include a map name or pipeline on the shape.
2) Blue Rectangle – Orchestration
3) Disk – Disk
4) Database – Database or Tables in Database
5) Cloud – Internet (FTP or HTTP access to outside company)
6) Red Rectangle – Pollers (C# programs that read database and create XML files)

NOTE: There is a package of Visio 2013 Stencils for BizTalk (by Sandro Pereira).  I have not yet used them, but they relate to representing Biztalk Server physical architectures, integration architectures and solution diagrams.

I’ve also used http://Draw.IO, as sometimes, not everyone has access to a license of Visio.

The following is an example from a larger project where we were processing a variety of Rosetta Net documents. The diagram also includes the project management number for each task (this company was using a system called “Redmine“).  In the example below, I wanted to emphasize some of the logic of the orchestration, and I had room, since I had was putting only one or two Rosetta documents per page. I also included the name of the developer working on in the header (removed from diagram below), as each developer was working on maybe 2-3 Rosetta documents.

Here are some of the shapes and colors I’ve been using as part of standard Visio:
1) Light Yellow Parallelogram – Receive or Send Port – If relevant, I often include a map name or pipeline on the shape.
2) Large Green Portrait Rectangle – New Development Orchestration for this application [all it’s main logic is to the right]
3) Green Landscape Rectangle, Diamonds, etc… – Steps in the orchestration
3) Cylinder – Disk and DB
4) Blue Rectangle – This was an existing orchestration that we share across applications
5) Purplse Hexagram – Pollers (C# programs that read database and create XML files)


There is also a free tool called Biztalk Documenter. It’s project description says:

This tool creates documentation for a given  BizTalk server 2006, 2006R2 2009, 2010, 2013, 2013R2 or 2016 TAP installation. This project has used the source code of the original BizTalk 2006 Documenter , updated and improved it. We have also added the SSO documentation by the Red Eyed Monster from the BizTalk 2010 documenter

The related bog is “Documenting Your BizTalk Solutions“.  That blog has a full set of screen shots to show you what comes out of this tool.

When I’ve had one or more long complicated orchestrations, that need extra documentation, I have used TechSmith’s SnagIt to take screen shots, and paste into a Word document.  Then I write paragraphs of text in the document describing what needs further clarification.  Unfortunately, BizTalk Orchestrations don’t have a “text” or “doc” shape.  I often use “Group” shapes in BizTalk Orchestrations to provide additional documentation “inline”, and I even nest them if I need more text than will fit.  I also put long text on the Decide shapes if that is helpful.  Here’s an example:


There are advantages and disadvantages to both manual and automated documentation.  Obviously, the automated documentation can be updated any time by just re-running it. But it is usually bulky and sometimes too detailed, and much too large to print.  I’ve always preferred or one or twp page diagram that summarizes the whole system with “the big picture”.  As of yet, I think only a human can do this.  Part of the art is when to abstract – i.e. what to include in the diagram, and what to leave out.  If you try to include too much, you will end up with 3 to 5 pages of diagrams and then you can get lost in the detail.  If you omit too much, then the diagram may be of little value.   It’s even possible that you might want both, a very high level diagram for management, and then a more detailed diagram for architects and developers.


Neal Walters has been work exclusively with BizTalk since the 2002 release, and has both been a Microsoft Trainer of BizTalk and a consultant since 2004.  He is now developing a Dallas SEO agency (Search Engine Marketing).


One way to check for missing data is to do an xpath count.

The two-step approach (put the xpath in a variable first). Some might find this code cleaner, but you use a variable. Note that you have to use the conversion statement to convert the string result of the xpath to a number, if you need to test that number as I do in the following “if” statement.


strCountMessageKeysXPath = "count(//*[local-name()='MessageKey']";

intCountMessageKeys =

// Yes you can put if statement in expression shapes (but not message assignment shapes) 
if (intCountMessageKeys >= 2) 
   strXPath = "//*[local-name()='MessageKey'][2]"; 
   strWebRespMessage2Key = xpath(msgCreateSPServiceOrderAckResp.parameters,"string(" + strXPath + ")"); 


The one-step approach:


strCountMessageKeysXPath = ;

intCountMessageKeys =
// Yes you can put if statement in expression shapes (but not message assignment shapes) 
if (intCountMessageKeys >= 2) 
   strXPath = "//*[local-name()='MessageKey'][2]"; 
   strWebRespMessage2Key = xpath(msgCreateSPServiceOrderAckResp.parameters,"string(" + strXPath + ")"); 



NOTE: The reason I have .parameters after the message is that it is a multi-part message.
If you don’t get that correct, you may get the error “The expression you have entered is not valid”, or “An xpath expression must be of the form” if you hover over the error.