0

ASP .NET Core 3.1

System.DllNotFoundException: Unable to load shared library 'urlmon.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liburlmon.dll: cannot open shared object file: No such file or directory at FindMimeFromData(IntPtr pBC, String pwzUrl, Byte[] pBuffer, Int32 cbSize, String pwzMimeProposed, Int32 dwMimeFlags, IntPtr& ppwzMimeOut, Int32 dwReserved) at ValidateMimeType(List`1 colBytesFile, htconstructorparams htConstructorParams) in \Share.cs:line 5048 at ValidateFileMimeType(HttpRequest request, htconstructorparams htConstructorParams) in \Share.cs:line 5019 at FileMiddleware.Invoke(HttpContext context) in ''\FileMiddleware.cs:line 43 at JwtMiddleware.Invoke(HttpContext context, IUserSessionService _userSessionService) in ''\JwtMiddleware.cs:line 79 at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at ErrorHandlerMiddleware.Invoke(HttpContext context, hk_log_dbcontext logDbContext)

Asif Ahmed
  • 23
  • 6

1 Answers1

0

urlmon.dll is a Windows component.

ASP.NET Core is cross-platform, but when you run it on Linux, you can't access any libraries, features or files that are Windows specific, such as urlmon.dll.

If you want to find out the mime type of a file on Linux, you might have to use a Linux-specific solution such as How can I find out a file's MIME type (Content-Type)?.

omajid
  • 14,165
  • 4
  • 47
  • 64