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

Add SSRS project created in BIDS to MVC3 project
Foreign Key Just showing a number which is associated with the primary key
C# XNA movement not working, can't figure why
Convert mp4 to mp3 [closed]
opening a document and waiting for a user to finish editing it
Why is there no “date” shorthand of System.DateTime in C#?
Entity Framework - Why Does This Work?
Create a NHibernate Dialect that adds with(nolock) to every SELECT [duplicate]
I do not have a 'Any CPU' option present in my Configuration Manager
WCF Data Services, Entity Framework, LINQ -> Children within children
How do I determine the sender of an email via Exchange Web Services in C#?
c# fast sort and retrieve for small amount of key value pairs
MySQL Connector - removes polish characters
Project to create a book search website [closed]
C# visual control for editing statements / equations / conditions?
Generate new menus at timed intervals

Categories

HOME
ns2
network-programming
mysqli
azure-database-mysql
spotfire
cryengine
ubuntu-14.04
google-app-maker
apache-httpclient-4.x
mamp
element
android-wifi
email-client
apdu
windowserror
scrapy-spider
jira-zephyr
inspec
hierarchy
vtd-xml
arp
visual-prolog
snapkit
ilog
offset
gitosis
flex3
respect-validation
multi-user
client-server
jslider
azure-web-roles
glide-image-library
mtm
python-venv
mef
fluent-nhibernate-mapping
trusted-computing
optional-parameters
mac-app-store
settext
instaparse
kik
phpdesigner
wordpress-plugin
play-json
gitk
transbase
exchange-server-2007
first-order-logic
skview
veeam
accpac
attiny
aiff
illegalargumentexception
xmlserializer
lwuit
nsmutableurlrequest
dayofweek
kuka-krl
flask-mongoengine
thucydides
grape-api
pechkin
biztalk-deployment
gpl
aspmenu-control
github-archive
advanceddatagrid
cgaffinetransform
capitalization
mcpd
wdm
xpolog
auto-compile
datarelation
mysql-logic
web-search
opengl-to-opengles
ffdshow
tracd
memory-consumption

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