【问题标题】:Unable to load shared library 'urlmon.dll' on linux environment无法在 linux 环境中加载共享库 'urlmon.dll'
【发布时间】:2021-11-30 02:12:43
【问题描述】:

ASP .NET Core 3.1

System.DllNotFoundException:无法加载共享库“urlmon.dll”或其依赖项之一。为了帮助诊断加载问题,请考虑设置 LD_DEBUG 环境变量: liburlmon.dll:无法打开共享对象文件:没有这样的文件或目录 在 FindMimeFromData(IntPtr pBC,字符串 pwzUrl,字节 [] pBuffer,Int32 cbSize,字符串 pwzMimeProposed,Int32 dwMimeFlags,IntPtr& ppwzMimeOut,Int32 dwReserved) 在 ValidateMimeType(List`1 colBytesFile, htconstructorparams htConstructorParams) 在 \Share.cs:line 5048 在 \Share.cs:line 5019 中的 ValidateFileMimeType(HttpRequest request, htconstructorparams htConstructorParams) 在 FileMiddleware.Invoke(HttpContext context) in ''\FileMiddleware.cs:line 43 在 JwtMiddleware.Invoke(HttpContext context, IUserSessionService _userSessionService) in ''\JwtMiddleware.cs:line 79 在 Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext 上下文) 在 Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext 上下文) 在 Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext 上下文) 在 Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) 在 Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext,ISwaggerProvider swaggerProvider) 在 ErrorHandlerMiddleware.Invoke(HttpContext context, hk_log_dbcontext logDbContext)

【问题讨论】:

    标签: asp.net-core nginx centos


    【解决方案1】:

    urlmon.dll 是一个 Windows 组件。

    ASP.NET Core 是跨平台的,但是当您在 Linux 上运行它时,您无法访问任何特定于 Windows 的库、功能或文件,例如 urlmon.dll。

    如果您想在 Linux 上找出文件的 mime 类型,您可能必须使用特定于 Linux 的解决方案,例如 How can I find out a file's MIME type (Content-Type)?。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-26
      • 2014-11-06
      • 2021-11-04
      • 2021-10-12
      • 1970-01-01
      • 2011-01-24
      • 2020-12-17
      相关资源
      最近更新 更多