BizTalk Server Application Project Visual Studio projects fails to migrate for BizTalk Server 2020

While migrating old BizTalk Server Visual Studio solutions into the latest version, in this case from BizTalk Server 2016/Visual Studio 2015 to BizTalk Server 2020/Visual Studio 2019, one of the first tasks we do is to open the solution in Visual Studio 2019.

By doing that, the first thing that Visual Studio does is to try to see if the framework is available; otherwise, it proposes another alternative framework.

We say Ok, and basically it will load all our solutions and all the projects inside. Of course, then we may need to perform small fine-tune configurations like:

  • Setting up the correct .NET Framework;
  • Fixing the deployment settings of the projects, mainly the Server name and Application Name
  • and so on.

Typically, it is that simple, but sometimes, you find things you are not expecting and get surprised. This is one of those cases!

While migrating one BizTalk solution, I realized several projects failed to load into Visual Studio 2019

Some of them were identified as CI/CD (based on the folder name), which led me to correlate these projects with the “new” BizTalk project type for DevOps CI/CD – the BizTalk Server Application Project.

All those projects were failing with the following error:

The project file cannot be opened. Project “C:\Program Files (x86)\Microsoft BizTalk Server\Developer Tools\BuildSystem\CustomProject.Default.props” was not imported by “<solution-path>\Invoice.App.btaproj” at (7,3), due to the file not existing.

Cause

Of course, the cause is quite evident in the error message, the files don’t exist. But understanding why the file doesn’t exist was unclear to us since all the components needed to develop the BizTalk solutions were installed.

After much research, I did understand that the .btaproj struct file is the same from BizTalk Server 2016 to BizTalk Server 2020, but inside the following configurations are different:

  • The property Project > PropertyGroup > CustomProjectExtensionsPath
    • 2016 has: $(BTSINSTALLPATH)\Developer Tools\BuildSystem\
    • 2020 needs to be: $(MSBuildExtensionsPath)\Microsoft\BizTalk\BuildSystem\
  • The property Project > Import
    • 2016 has:
      • Project=”$(CustomProjectExtensionsPath)CustomProject.Default.props”
      • Project=”$(CustomProjectExtensionsPath)CustomProject.props”
      • Project=”$(CustomProjectExtensionsPath)CustomProjectCs.targets”
    • 2020 needs to be:
      • Project=”$(CustomProjectExtensionsPath)CustomProject.Default.props”
      • Project=”$(CustomProjectExtensionsPath)CustomProject.props”
      • Project=”$(CustomProjectExtensionsPath)CustomProject.targets”

So the files are no longer in:

  • C:\Program Files (x86)\Microsoft BizTalk Server\Developer Tools\BuildSystem\

And now they are available in

  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\BizTalk\BuildSystem

And one of the files has a different name.

For that reason, those projects failed to load into Visual Studio 2019.

Solution

The solution is quite simple:

  • We need to open the .btaproj file in a text editor like Notepad++ and manually perform these changes:
    • Replace this value $(BTSINSTALLPATH)\Developer Tools\BuildSystem\ for
      • $(MSBuildExtensionsPath)\Microsoft\BizTalk\BuildSystem\
    • Replace this value Project=”$(CustomProjectExtensionsPath)CustomProjectCs.targets” for
      • Project=”$(CustomProjectExtensionsPath)CustomProject.targets”

Of course, this works for simple solutions, but if you have complex solutions with multiple .btaproj files, this will become a nightmare and a time-consuming task.

Of course, there is a better, faster, and easier way. And for that, I have created a PowerShell script in which you provide the root path for your BizTalk Server Visual Studio solution, and the script will go to all folders trying to find a BizTalk Server Application Project. Once it is found, it will automatically fix all those settings.

THIS POWERSHELL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

I hope you find this helpful! If you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top