Click here to Skip to main content
15,891,645 members
Articles / Hosted Services / Web Hosting

The Next Logical Step Using Azure Functions - How to Integrate a Native DLL via P/Invoke ([DllImport])

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
10 Feb 2020CPOL6 min read 22.2K   6  
YES, you can - use native DLLs in your Azure Functions via P/Invoke ([DllImport]) as you already know it from .NET Framework, and safe the code you have developed and maintained for decades with much effort and patience.
Illustrated guide on how to integrate a native DLL into Azure Functions. I use Visual Studio 2019, .NET Core 3.1 and .NET SDK Functions 3.0.3 for the managed DLL that contains the Azure Functions. I add a Pre-build event command line to the C# Azure Function project that copies the native DLL into the source code folder of the C# Azure Function project.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader Celonis SA
Germany Germany
I am currently the CEO of Symbioworld GmbH and as such responsible for personnel management, information security, data protection and certifications. Furthermore, as a senior programmer, I am responsible for the automatic layout engine, the simulation (Activity Based Costing), the automatic creation of Word/RTF reports and the data transformation in complex migration projects.

The main focus of my work as a programmer is the development of Microsoft Azure Services using C# and Visual Studio.

Privately, I am interested in C++ and Linux in addition to C#. I like the approach of open source software and like to support OSS with own contributions.

Comments and Discussions