microsoft / microsoft/CsWin32

Allow UserDirectories in DefaultDllImportSearchPaths for AppLocalAllowedLibraries

Open
#1,628 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
2.5k
Forks
124
Avg merge
1d 3h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.
Some 3-rd part dlls is not in the root of application/assembly directory, such as when references the jre, the jvm.dll is at bin/server/jvm.dll. In this case, we need to use AddDllDirectory and set AppLocalAllowedLibraries to reference the dll.

Describe the solution you'd like
Use SafeDirectories for AppLocalAllowedLibraries or add a property such as

<ItemGroup>
  <AppLocalAllowedLibraries Include="jvm">
    <DefaultDllImportSearchPaths>System32;ApplicationDirectory;AssemblyDirectory;UserDirectories</DefaultDllImportSearchPaths>
  </AppLocalAllowedLibraries>
</ItemGroup>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by tracing how AppLocalAllowedLibraries and SafeDirectories are handled, then verify the proposed UserDirectories setting or equivalent XML configuration works for a DLL located in a subdirectory such as bin/server and does not regress existing search paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.