dotnet / dotnet/SqlClient

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

Open
#903 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
989
Forks
340
Avg merge
4d 19h
Merged PRs (30d)
72

Description

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](https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks#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](https://github.com/NuGet/docs.microsoft.com-nuget/issues/600) and https://github.com/ericsink/SQLitePCL.raw/issues/389#issuecomment-749792799

Note: I have discovered this while trying to [embed `Microsoft.Data.SqlClient.dll` with Costura 5 (beta)](https://github.com/Fody/Costura/issues/651).

Contributor guide

Open the contributing guide

Research direction

Compare the identical files under microsoft.data.sqlclient\2.1.1\lib\net46 and runtimes\win\lib\net46, including their PDBs, and read the linked NuGet Architecture-specific folders documentation. Determine whether the duplicate assets are required, then document the packaging behavior or identify the package change needed to remove the duplication.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.