Skip to content

[DllImport] on Windows fails to load library on case sensitive filesystem #66608

Description

@wikancz

Description

[DllImport] on Windows fails to load library on case sensitive filesystem
System: Windows 10 (21H1)
.net version: 6.0
File system: NTFS with SetCaseSensitiveInfo enabled

Reproduction Steps

  1. have Windows with case sensitive filesystem: fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable
  2. have somelibrary.dll - note all letters are lower case
  3. use [DllImport("somelibrary")] without specifying extension
  4. run project

Expected behavior

Project correctly loads somelibrary.dll.

Actual behavior

Project fails with exception:
DllNotFoundException: Unable to load DLL 'somelibrary' or one of its dependencies: The specified module could not be found. (0x8007007E)

Regression?

No response

Known Workarounds

Rename library to somelibrary.DLL.

Configuration

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions