Unable to load shared library 'user32.dll' or one of its dependencies.

zzonalivre 1 Reputation point
2021-11-10T02:38:14.117+00:00

Greetings.
I have an api made in asp.net core hosted on Azure and one of the services offered by the api is the generation of .pdf files that are downloaded by a webapp. To solve the problem of storing these generated .pdf files, I created a storage account and created a container to store the generated files. I did the tests with the local api, and everything worked fine, however, when I use the api that is in Azure I'm getting this exception message: Unable to load shared library 'user32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libuser32.dll: cannot open shared object file: No such file or directory

The error description indicates that the file or directory was not found, however, in the local api everything goes fine, and I also checked if the file is being generated and stored in the storage account's container, and it is. What could be going wrong?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce Barker 801 Reputation points
    2021-11-10T16:36:32.863+00:00

    azure is 64 bit only. you will need to use 32 bit VM, or get a 64 bit version of the library used.

    0 comments No comments

  2. zzonalivre 1 Reputation point
    2021-11-13T12:20:59.727+00:00

    After analyzing the problem, I found that maybe one of my nuget packages could be causing the problem. I was using the PdfSharp package to generate my pdf files, however the package I was using was incompatible with Asp.Net Core. It worked fine on my local machine, as it was a Windows system, but in hosting the service, as it was a Linux machine, the problem occurred when generating the pdf.
    I switched from the PdfSharp package to the PdfSharpCore package and everything works fine now.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.