Migrate .NET solutions for Windows-based HDInsight to Linux-based HDInsight
Linux-based HDInsight clusters use Mono (https://mono-project.com) to run .NET applications. Mono allows you to use .NET components such as MapReduce applications with Linux-based HDInsight. In this document, learn how to migrate .NET solutions created for Windows-based HDInsight clusters to work with Mono on Linux-based HDInsight.
Mono compatibility with .NET
Mono version 4.2.1 is included with HDInsight version 3.6. For more information on the version of Mono included with HDInsight, see HDInsight component versions.
For more information on compatibility between Mono and .NET, see the Mono compatibility (https://www.mono-project.com/docs/about-mono/compatibility/) document.
Automated portability analysis
The .NET Portability Analyzer can be used to generate a report of incompatibilities between your application and Mono. Use the following steps to configure the analyzer to check your application for Mono portability:
Install the .NET Portability Analyzer. During installation, select the version of Visual Studio to use.
From Visual Studio 2015, select Analyze > Portability Analyzer Settings, and make sure that 4.5 is checked in the Mono section.
Select OK to save the configuration.
Select Analyze > Analyze Assembly Portability. Select the assembly that contains your solution, and then select Open to begin analysis.
Once analysis is complete, select Analyze > View analysis reports. In Portability Analysis Results, select Open report to open a report.
The analyzer cannot catch every problem with your solution. For example, a file path of
c:\temp\file.txt is considered OK if Mono is running on Windows. The same path is not valid on a Linux platform.
Manual portability analysis
Perform a manual audit of your code using the information in the Application Portability (https://www.mono-project.com/docs/getting-started/application-portability/) document.
Modify and build
You can continue to use Visual Studio to build your .NET solutions for HDInsight. However, you must ensure that the project is configured to use .NET Framework 4.5.
Deploy and test
Once you have modified your solution using the recommendations from the .NET Portability Analyzer or from a manual analysis, you must test it with HDInsight. Testing the solution on a Linux-based HDInsight cluster may reveal subtle problems that need to be corrected. We recommend that you enable additional logging in your application while testing it.
For more information on accessing logs, see the following documents: