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

It is ok to store a Thread in a static variable?
How to copy data from Windows phone app internal storage to SD card or phone
Main thread freezes when waiting for Web service synchronously in Windows Phone Silverlight Application 8/8.1
ASP .NET GridView not displaying rows
SQL stored procedure not returning all SELECT statements
C# Calculate the image scroll with scrollbar
stream audio and video data separately
Azure Active Directory Authentication with Azure Mobile Services Failed
Xamarin Parse Component refresh current user
How to use Automapper to map an object to an interface at a different level?
ASP.Net C# equivalent to Coldfusion cfoutput GROUP
HtmlAgilityPack convert XPath query to LINQ
How to assign System.Drawing.Color to Microsoft.Office.Interop.Excel.ColorFormat
Construct a list of wpf Hyperlink elements from an XML source file using Linq
Exception while using Regex with richtextbox in C#
Is there is a way to generate “simple” url with #Url.Action?

Categories

HOME
youtube-api
teradata
locale
customization
bigtable
c++builder
mingw
rethinkdb
android-webview
osx-yosemite
ephesoft
pyodbc
olap
theory
activejdbc
xmlhttprequest
swift3.1
virtuemart
airbnb
sonarlint
webgl-earth
descriptor
javaagents
wai-aria
prepros
policy
tftp
multiple-inheritance
marionette
scripting-language
emr
restangular
javapns
hierarchy
2checkout
arp
schedule
directions
contextmenustrip
scene7
circle
webspeech-api
http-proxy
incapsula
minitest
extern
framebuffer
stdin
linkurious
wicket-tester
mtm
uitextview
servicebus
android-doze-and-standby
mef
activeandroid
google-cloud-shell
jscoverage
intermediate-language
was
timex
catalyst
qt3d
addressbook
copy-constructor
directinput
easy68k
dbi
joystick
disconnect
mate-desktop
jcalendar
firefox-os
overlapping
kramdown
tvp
mojolicious
exchange-server-2007
stereotype
bungeecord
react-os
dirname
ccmenuitem
slimscroll
windows-phone-store
facebook-java-api
kuka-krl
nativequery
facebook-likebox
complete
kademlia
dd4t
symbian3
select2-rails
configurationsection
orchestration
mail-gem
winrt-async
dancer
jmesa
virtual-printer
httppostedfilebase
xpolog
windows-xp-embedded
service-layer
functional-specifications
cryptolicensing
html5-animation
http-response-codes
for-xml
versions
mysql-pconnect
datadude
user-preferences
weak-typing
stackless

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