Win32 DLL not found error in Azure Web Application

1

I have a web application which is hosted in Azure. When I run the app and authenticate the user, I am getting the error "One of the dependent DLL not found".

Background:

In the web application, I am using fingerprint scanner functionality to capture a fingerprint image. To capture fingerprint image during user registration, I am using a javascript library and it works fine. I am storing the fingerprint in storage. When a user logs in into the website, I need to perform authentication and again I capture fingerprint from the user and compare it with one associated with the user. For comparing two fingerprint images on server-side, my C# code calls fingerprint scanner SDK which in turn calls dependent DLL's (from System32) which I guess comes with fingerprint scanner SDK. When I run the site locally, it works fine (as I have fingerprint SDK installed on the local machine). But when I deploy the application on Azure and this code execute, I am getting the error "One of the dependent DLL not found". I understand run time is looking for one of the dependent DLL from the system32 folder which is not there in the Azure environment.

I tried copying fingerprint scanner DLL's to Azure web apps bin folder but it not working. I am getting the error An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B).

Image - which shows DLL added to root folder

I also tried to include system 32 DLLto .net core class library project but it gives error The reference is invalid or unsupported

Image - Error while adding system32 DLL to .net core project

Is there any way to install third party software on the Azure web app?

c#
azure
asp.net-core
azure-web-sites
paas
asked on Stack Overflow Jun 10, 2019 by Amol Gunjal • edited Jun 11, 2019 by Amol Gunjal

3 Answers

1

You can't directly install 3rd party DLLs in App Service. One way around that is to deploy your app in a Windows container that App Service will pull and run. Another way is to use a virtual machine instead of App Service, this way you have full control of the machine and you can install whatever you want.

answered on Stack Overflow Jun 10, 2019 by CSharpRocks
0

One possibility is to use Windows Containers in App Service.

Here you can follow the quickstart to run a Windows Container in App Service:

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-windows-container

 

answered on Stack Overflow Jun 12, 2019 by Joaquín Vano
0

Following will be the steps to resolve the issue

• Make sure correct native library (Third party DLL’s) copied to a wwwroot folder on the server (either 64bit or 32 bit)

• Check azure web service configuration platform (If third party dll is 64 bit then change to 64 bit)

• From the visual studio, while publish an application using web deploy to make sure deployment mode is self-contained and Target runtime win-x64

Additional things that need to take care

• If the project is in the .net core then we can not add direct third part dll reference, we need to add an existing item and in property of dll make sure it copies always

• Change Platform target to 64 or 32 bit as per project requirement

Above steps works for me

answered on Stack Overflow Jun 13, 2019 by Amol Gunjal

User contributions licensed under CC BY-SA 3.0