简体   繁体   English

我是否应该在NuGet包中包含多个目标框架的dll

[英]Should I include in NuGet package dlls for multiple target frameworks

Let's consider a library project which should run on three .NET runtimes: net20, net35 and net46. 让我们考虑一个应该在三个.NET运行时上运行的库项目:net20,net35和net46。 The source code remains the same for all versions. 所有版本的源代码均相同。

When releasing should i build the project 3 times with different TargetFrameworkVersion property values in order to generate 3 dlls, one for each .NET version, and than include all three in the nupkg file in lib/<target framework>/ directories? 发布时,我应该使用不同的TargetFrameworkVersion属性值来构建该项目3次,以便生成3个dll,每个.NET版本一个,然后在lib/<target framework>/目录的nupkg文件中包括所有三个。 Or is it just fine to include only .net 2.0 dll and it will work just fine on newer runtimes. 或者只包含.net 2.0 dll也可以,并且在较新的运行时中也可以正常运行。

如果仅使用在2.0版上编译的代码,则无需包括其他框架版本。

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

相关问题 如何使nuget包正确地针对多个框架? - How do I make a nuget package target multiple frameworks correctly? 如何为 nuget 包构建具有多个 .net 框架的项目 - How can I build a project with multiple .net frameworks for nuget package 多目标框架项目:同一个 NuGet package 在不同框架上的不同版本? - Multiple target framework project: different versions of the same NuGet package on different frameworks? 如何在我的新 CSPROJ 类库中包含带有本机 dll 的 NuGet 包? - How can I include a NuGet package with native dlls in my new CSPROJ Class Library? 我应该如何在nuget包中包含与MVC相关的命名空间? - How should I include MVC related namespaces in a nuget package? NuGet Package 具有多个目标依赖项 - NuGet Package with multiple target dependencies 解决多个标准框架的 NuGet 包 - 可空值问题 - NuGet package addressing multiple Standard frameworks - problem with nullables 如何将 C# DLL 包装到 Ubuntu 上的 NuGet package? - How can I wrap C# DLLs into a NuGet package on Ubuntu? 我可以在安装 NuGet 包时解决添加这些.dll 的问题吗? - Can I work around adding these .dlls when installing NuGet package? 为什么我应该将 NuGet 包 dll 添加到源代码管理中? - Why should I add NuGet packages dlls to source control?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM