简体   繁体   English

通过 Nuget 安装库时,系统命名空间中包含许多 DLL

[英]Many DLLs in System namespace are included when installing library via Nuget

I'm writing a C# library targeting .NET Standard 2.0 and .NET Framework 4.6我正在编写一个面向 .NET Standard 2.0 和 .NET Framework 4.6 的 C# 库

In other projects (targeting .NET Framework 4.6.1):在其他项目中(针对 .NET Framework 4.6.1):

  1. When I directly references my library project, the number of produced DLLs are reasonable.当我直接引用我的库项目时,生成的 DLL 的数量是合理的。

  2. However, when I publish the library to Nuget and install it in other projects, I get an additional 100+ files, and almost all of them are System.*但是,当我将库发布到 Nuget 并将其安装在其他项目中时,我又得到了 100 多个文件,而且几乎所有文件都是 System.*

I wonder if this is due to me misconfigure something when publishing the library to NUGET, or because of something else?我想知道这是因为我在将库发布到 NUGET 时配置错误,还是其他原因?

This is expected.这是预期的。 Those additional files are required at runtime to make sure your .NET Standard 1.* libraries run on .NET Framework 4.6 and higher.运行时需要这些附加文件,以确保您的 .NET Standard 1.* 库在 .NET Framework 4.6 及更高版本上运行。

You can read more about this here .您可以在此处阅读更多相关信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM