Is there a way to pack and push a NuGet package to a specific framework, in my case it being net35?
I want to push a package so when other's install it, it will show as targetFramework="net35" in their packages.config.
Can I specify this in the .nuspec?
You can create a NuGet package so that your assembly is in a lib\net35 folder. However the value that gets added to the packages.config file is the target framework of the project not the assembly used from the NuGet package.
To target .NET 3.5 in your NuGet package your .nuspec file would have something similar to:
<files>
<file src="bin\**" target="lib\net35" />
</files>
If you are using nuget pack YourProject.csproj
then instead of specifying the assemblies in your .nuspec file you should instead change your project to target .NET 3.5. Then nuget pack should create the correct lib\net35 directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With