[英]Simplest way to target multiple framework in nuget?
I created a library that uses: generics, extension methods and Func
delegate. 我创建了一个使用:泛型,扩展方法和
Func
委托的库。 Func
delegate is most new feature to .NET (version 3.5) in the library. Func
委托是库中.NET(版本3.5)的最新功能。 When I published it to nuget, the project was targeting the .NET version 4.5.2 but when I tried to install it to a project that target version 4.5, it failed. 当我将它发布到nuget时,该项目的目标是.NET版本4.5.2,但当我尝试将其安装到目标版本为4.5的项目时,它失败了。
How to ensure that the package will be installed on any project that targets .NET 3.5 and later versions, should I change the target framework in the library to 3.5 or I should use the directory convention, and create separate dll for every framework, explained here: 如何确保软件包将安装在任何面向.NET 3.5及更高版本的项目上,如果我将库中的目标框架更改为3.5或者我应该使用目录约定,并为每个框架创建单独的dll,在此处说明:
Target the package for 3.5 which means the lib folder should be like this. 将包定位为3.5,这意味着lib文件夹应该是这样的。
lib\\net35
LIB \\ net35
If a package targets net35, it can be installed in any project that targets .NET 3.5 or above. 如果程序包以net35为目标,则可以将其安装在任何面向.NET 3.5或更高版本的项目中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.