在Nuget软件包中使用特定的SDK DLL

发布于 2025-01-27 18:53:57 字数 541 浏览 5 评论 0原文

我正在用net6.0编译代码。

我的一个依赖项目之一,用netStandArd2.0编译,正在使用带有dlls的nuget软件包,用于netStandard2.0net5.0(and Code>) NetStandard1.1net45)。

在输出文件夹中,我看到它采用net5.0 dll。

我该如何选择netStandard2.0 dll?


该要求是 dotfuscator ,因为它寻找net5.0运行时,根据net5.0 dll。应该问有关 dotfuscator 的问题,但是我正在一项研究中,以更好地了解 dotfuscator ,因此,同时我询问了Nuget。

I'm compiling my code with net6.0.

One of my depends projects, compiled with netstandard2.0, is using a Nuget package with DLLs for netstandard2.0 and net5.0 (and also netstandard1.1 and net45).

In the output folder, I see it takes the net5.0 DLL.

How can I choose to take the netstandard2.0 DLL?


The requirement is for Dotfuscator, because it looking for the net5.0 Runtime, according to that net5.0 DLL. The question should be asked about Dotfuscator, but I'm in the middle of a research to understand the Dotfuscator better, so in meanwhile I'm asking about the Nuget.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抚笙 2025-02-03 18:53:57

基本上,netStandard2.0或任何netStandard目标实际上是汇编为NetStandstandNetStandard不是运行时,它是API的规范在不同的运行时使用相同的代码库。根据您编译的运行时间,NetStandard库将编译到其中。

基本上,由于您将应用程序编译为net6,因此您的netStandard2.0库也以net6库来编译。然后,它将使用正确的依赖项(net5一个)进行编译。

Basically, netstandard2.0 or any of the netstandard targets are actually compiled to netstandard. netstandard isn't a runtime, it's a specification of the API's that are shared between runtimes such as net5, net45, etc, allowing you to use the same codebase over different runtimes. Depending on which runtime you compile for, the netstandard library will be compiled to that.

Basically, since you are compiling your application in net6, your netstandard2.0 library is also compiling as a net6 library. It then will use the correct dependencies (the net5 one) to compile.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文