Overcoming WinSCP Assembly Issues in BizTalk 2016

Recently I was having issues on BizTalk 2016 getting the SFTP adapter to work correctly. I had followed all of the steps listed at Michael Stephenson’s blog entry here, but I was still getting this error:

A message sent to adapter “SFTP” on send port “<send port name>” with URI “sftp://<port URI>” is suspended.
Error details: System.TypeLoadException: Could not load type “WinSCP.RemotePath” from assembly “WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=…”

I made sure nothing was GAC’ed and the correct version of the dll was in the BizTalk program files folder, but still I had this error.

I was able to add a reference to the dll that had this version in a project and in the object browser it showed that the RemotePath type did not exist in the dll file. I checked on Nuget for WinSCP but could not find a version that matched and had the RemotePath type in it.

Here is my solution:

  1. I downloaded the absolute latest version from the Nuget WinSCP site. When running Michael’s script it downloads an older version of the dll. I installed the absolute latest version and then copied the WinSCP.exe and WinSCPnet.dll files from the C:\Program Files (x86)\WinSCP folder to the BizTalk program files folder just like the script does. For me the files had version 1.7.2.10905
  2. Then I added an assembly binding redirect to the BizTalk config files (what I added is between the dependentAssembly tags in purple):
<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop" />
      <dependentAssembly>
        <assemblyIdentity name="WinSCPnet" publicKeyToken="2271ec4a3c56d0bf" culture="neutral" />
        <bindingRedirect oldVersion="1.3.7.7601" newVersion="1.7.2.10905" />
      </dependentAssembly>

    </assemblyBinding>
  </runtime>

This binding redirect ensures that a version of the WinSCP code runs that has the RemotePath type when the version 1.3.7.7601 is invoked. It appears the BizTalk SFTP adapter was bound to this version but I could not find a version that had the RemotePath type.

I updated both the BTSNTSvc.exe.config and the BTSNTSvc64.exe.config files and restarted the host instances.

Note: I noticed that the BizTalk 2016 CU 7 updated its support for WinSCP to a newer version so after applying the cumulative update the BizTalk SFTP adapter will be referencing a new version of WinSCP so you may not need this any longer after CU 7.

No more BizTalk forums?

I was checking on the community recently and found that the MSDN BizTalk forums had all been closed since September 2020 and the new Microsoft Q&A site that is supposed to be the new home for Microsoft forums did not have any BizTalk tags and the Microsoft people were all tagging the BizTalk questions as “not-supported” because they did not think you could post a BizTalk question on the Q&A site.

This seems completely wrong.

I looked at the BizTalkGurus.com page that used to have forums but the site did not appear to be working any more. I could not get the forum topics to show up now.

I used to support the BizTalk forums a long time back so I am surprised to see them basically just gone now. I was surprised too when the Microsoft physical stores closed up completely too. All I can suggest is to try tagging a post on the Q&A site as azure-logic-apps and then talk about BizTalk there.

You can still reach me on this site if you have any questions or look me up on LinkedIn.

Surface Power Supply Fix

New Surface hack: Using a power cord from a printer instead of the provided outlet cord.

My Surface 3 power adapter has recently stopped working. There are 2 parts to it – the part that connects to the device and the part that connects to the outlet. These both connect together to form the power supply. For a while I had trouble with the combined parts and it only worked again when I rammed the 2 parts together to form a very strong connection. The combined parts stopped working today.

After looking at the part that goes to the outlet I realized it looked just alike to power adapter used with most printers. So I swapped it out with my printer cord and my Surface is charging again!

This should be a much better replacement part than buying a whole new Surface power adapter for up to $100. Just find your HP printer (or buy a super cheap one anywhere) and use this part instead.

I will add some pictures here soon.

Changes in ADFS 2.1 from ADFS 2.0

Well it has been a while since I last posted. I have been sitting on a couple things and wanted to get this information out there.

Recently I had to work on an ADFS 2.0 to 2.1 migration. There is apparently not any supported easy way to upgrade an ADFS environment to work on Windows Server 2012 with SQL Server 2012. I had to recreate all of the ADFS artifacts such as claim provider trusts, relying party trusts, attribute stores, etc. This is a little painful if you created all of these manually but is much easier if you have saved off PowerShell scripts for creating these objects.

In this post I am blogging about the changes I uncovered working with ADFS 2.1. Most of the changes to ADFS in 2.1 are relatively trivial. In my experience almost everything appears the same in the user interfaces for ADFS. Now the ADFS installation is a role rather than a separate hotfix installer and is part of the base Windows Server 2012 install.

If you have saved off any scripts or other tools for working with ADFS 2.0, you will need to update these for ADFS 2.1. Changes that will be required are:

  • The ADFS PowerShell snap-in is no longer required to be added manually. This was my experience with having the PowerShell 3.0 feature installed. So any lines such as the following lines below can just be removed:

Add-PSSnapin Microsoft.ADFS.PowerShell
Remove-PSSnapin Microsoft.ADFS.PowerShell

  • Also, the PowerShell 3.0 ISE tool now includes Intellisense-like support so it is possible to enter cmdlet arguments much easier. This is a huge help.
  • The folder of the ADFS files is now at C:\Windows\ADFS rather than C:\Program Files\Active Directory Federation Services 2.0. If you use a script to call fsconfig.exe you will need to update the script with this new path to fsconfig.exe.
  • The custom claim rules policies base class is now in a .NET 4 assembly so you will be required to update all assemblies that reference this base class to .NET 4.0. So any classes that derive from Microsoft.IdentityServer.ClaimsPolicy.dll must have their build configuration updated to be .NET 4.0 or later.

Update!

I did find another change with ADFS 2.1. If you have made any customizations to the web.config file of the ADFS virtual directory, you will need to update the version details in the web.config as well as remove the reference to Microsoft.IdentityModel. What I did to update this file was to do the following find/replace tasks on the web.config:

  • Update 3.5.0.0 version details to 4.0.0.0
  • Update 6.1.0.0 version details to 6.2.0.0

I will keep updating this page with any other changes I find with ADFS 2.1. Thanks!

Awarded BizTalk MVP again – Woohoo!

Thanks Microosft for again awarding me as a BizTalk MVP today! It is a big honor to be in the program. This will be my third year in the MVP program.

Since I am still in the process of transitioning my blog from the old Live Spaces location, I do not yet have some of the logos for the MVP Award and links to my forums posts. I will be working on getting this added to my blog site this weekend. For anyone that is interested, here is a link to my MVP profile: https://mvp.support.microsoft.com/profile=F7CEAEDD-3119-4F75-B12C-A520904557C1. It mentions some of the various technical communities I am active in as well as some of the publications and speaking sessions I have done.

I realized that I have not really spoken much in a public way about the benefits of the MVP program. I am not sure if these comments about the program will hold true for all MVPs, this is just my experience. What I describe here is above and beyond all the software benefits given through the MVP program. In my mind the greater benefits are the many opportunities for career advancement and extension.

Here are a few things I love about the MVP program:

  • Great opportunities to be a bridge between Microsoft and technical communities – I have advocated on both clients and Microsoft’s behalf in many discussions. This is particularly helpful because there is a lot of miscommunication.
  • Early access to many products, initiatives, and planning sessions
  • Many opportunities for understanding how Microsoft works and functions
  • Excellent networking opportunities for connecting with other industry experts and veterans
  • Being in the MVP program requires me to stay competitive and relevant. This helps me keep up to date on my technical knowledge and focused on the future.

For anyone not in the MVP program, it is definitely something to aspire to and I think it is worth all of the hard, fun work. 🙂

Thanks,

Blog at WordPress.com.

Up ↑