Skip to content

Does it make sense to package the net46 Microsoft.Data.SqlClient.dll inside both the lib and runtimes directories? #903

Closed

Description

@0xced

I have noticed that both microsoft.data.sqlclient\2.1.1\lib\net46\Microsoft.Data.SqlClient.dll and microsoft.data.sqlclient\2.1.1\runtimes\win\lib\net46\Microsoft.Data.SqlClient.dll are absolutely identical files (their associated pdb files are also identical).

I think it doesn't make sense to have these file duplicated in the NuGet package. According to the Architecture-specific folders documentation, if the dll does not exist in the runtimes directory, then the one from the lib directory is used. At least, this is my understanding of this sentence:

Please note, NuGet always picks these compile or runtime assets from one folder so if there are some compatible assets from /ref then /lib will be ignored to add compile-time assemblies. Similarly, if there are some compatible assets from /runtimes then also /lib will be ignored for runtime.

But I may be wrong. Correct usage of the /lib and /runtimes directories is something that is definitely confusing and where more documentation would be welcome. See also Improve documentation on use of runtimes folder and RIDs and ericsink/SQLitePCL.raw#389 (comment)

Note: I have discovered this while trying to embed Microsoft.Data.SqlClient.dll with Costura 5 (beta).

Activity

  1. cheenamalhotra commented on Feb 10, 2021

    @cheenamalhotra
    Member

    Thanks for linking related issues.
    We'll consider reviewing this again once we get a clear image if we can omit runtimes\**\net46 DLLs.

    Our design came from System.Data.SqlClient NuGet and hence things were carried forward.
    But we can always review and revalidate!

  2. moved this from To triage to Backlog in SqlClient Boardon Jan 6, 2026
  3. moved this from Backlog to In progress in SqlClient Boardon Sep 10, 2026
  4. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

  5. github-actions commented on Sep 17, 2026

    @github-actions

    🔍 Triage Summary (on-demand re-triage)

    Check Result
    Issue type Task
    Environment Not applicable (packaging/build design question, no repro required)
    Area Area\Engineering
    Duplicates Related: #4461, #3898 (both touch on lib/ vs runtimes/ asset resolution confusion, not exact duplicates of this packaging question)
    Regression Not indicated

    Analysis

    This issue questions whether shipping an identical net46 Microsoft.Data.SqlClient.dll in both the lib/net46 and runtimes/win/lib/net46 NuGet folders is redundant, since NuGet falls back to /lib when no matching /runtimes asset exists. This is a packaging/build design concern (not a functional bug), affecting NuGet package size and clarity rather than runtime behavior. There is already an open pull request, #4673 ("Remove RID-specific SqlClient DLLs"), linked via closed_by_pull_requests that appears to address exactly this issue. Severity: P3 (low-impact packaging cleanup with an existing fix candidate).

    Next Steps

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for #903 · copilot · auto · 57.4 AIC · ⌖ 13 AIC · ⊞ 11.9K · ◷

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions