c#


Package multiple project into a single NuGet Package


I'm trying to wrap my head around the NuGet package system. Recently I released a class library for NuGet, targeting only .NET Framework 4.5.2, but as of demand, I decided to create a new class library targeting .NETStandard 1.4.
Here's where I get lost. Is is possible for me to target multiple frameworks in a single NuGet package, taking this scenario of having two different projects?
Would it make sense for me to remove the .NET Framework 4.5.2 project, and replace it with my .NETStandard 1.4 project? The code is 100% the same.
Any suggestions or best practices to navigate through such a scenario?
If you need to support .NET Framework 4.5.2, you'd need to lower the version of .NET Standard to 1.2 as per compatibility matrix since .NET Standard 1.4 packages can only be used on .NET Framework 4.6.1+.
If this is not possible for you, you can multi-target your project so that the same project is built for a version of .NET Standard and .NET Framework and packages into the same NuGet package. .NET Framework projects referencing that package will prefer the .NET Framework dll over the .NET Standard dll in the same package.
You can do this by changing the .NET Standard project from
<TargetFramework>netstandard1.4</TargetFramework>
to
<TargetFrameworks>net452;netstandard1.4</TargetFrameworks>
By changing the property to TargetFrameworks (plural), the project will now be built twice - once per specified framework.

Related Links

Encrypt text using Caesar cipher C# [duplicate]
Proxy GZIP Compression
Getting SQL to work from C# with Dates
Store Enum as Char with Dapper
Drag and Drop Windows Forms: Controls dissapear after dragging
What is the best way to count all instances of a single process running under a particular user logon?
C# Security Protocol Specification
Ajax Dropdownlist using cascading dropdownlist in asp.net
Adding textbox value with button in C#
How to show the tooltip without any time duration?
How can i hide in game view a ui button and show the button when pressing the escape key?
TCP Connection. best way to handle multiple connections [duplicate]
Send POST request with Image from Unity3D
How to make default Password Reset functionality work in ASP.NET Core
UriTemplate Matching Email
Error handling between web api and angular 2 client

Categories

HOME
gcc
azure-documentdb
teradata
windows-server-2008
xamarin.forms
livecharts
esxi
overrides
multipartform-data
install
phpexcel
google-search-appliance
fine-uploader
opengrok
web-worker
tag-cloud
reportlab
loader
legend-properties
url-parameters
descriptor
bug-reporting
aws-certificate-manager
my.cnf
deployment-descriptor
units-of-measurement
azure-table-storage
dynamics-ax-2012-r3
osgi-bundle
jbossfuse
exacttarget
ios-autolayout
loopback
respect-validation
gstreamer-1.0
abide
rtsp
stencyl
linkurious
fisheye
keychain
peerjs
amazon-fire-tv
runner
ajv
rmq
msiexec
therubyracer
sqlproj
lattice
easy-thumbnails
xcode7.1
jmap
jcalendar
web-optimization
factorization
gnu-sort
edgar
jain-sip
musicbrainz
beagleboard
sync
system.net
xts
telerik-appbuilder
vbaccelerator
xcode6.1-gm-seed
thucydides
pechkin
aspnet-compiler
kohana-orm
qgraphicsscene
forward-declaration
android-library
azure-scheduler
nx
expresso-store
waveout
android-memory
aspmenu-control
google-email-audit-api
visual-leak-detector
automapper-2
umfpack
parallel-python
opendir
symfony-1.2
qvariant
netduino
marathontesting
onunload
table-valued-parameters
system-analysis
newspeak
konsole

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App