New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do framework conditional references in paket.references work with .NET SDK-style projects? #3091

Closed
dsyme opened this Issue Feb 27, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@dsyme
Contributor

dsyme commented Feb 27, 2018

I've had trouble getting conditional references in paket.references working in the context of .NET SDK-style projects. Roughly speaking I had this in paket.references:

Nancy.Hosting.Self framework: net461

But I still get this error for when compiling TargetFramework=netcoreapp2.0 for a multi-targeting project:

C:\GitHub\dsyme\FSharp.Data\tests\FSharp.Data.Tests\FSharp.Data.Tests.fsproj : error NU1701: 
Package 'Nancy.Hosting.Self 2.0.0-clinteastwood' was restored using '.NETFramework,Version=v4.6.1' 
instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully
compatible with your project.

I would have thought that the framework: net461 would suppress the reference for netcoreapp2.0?

@dsyme

This comment has been minimized.

Contributor

dsyme commented Feb 27, 2018

(This is a question - I suppose I can create a repro if this is expected to work - thanks)

@baronfel baronfel referenced this issue Feb 28, 2018

Merged

Support .NET Core TP loading and netstandard2.0 #1118

17 of 21 tasks complete
@forki

This comment has been minimized.

Member

forki commented Feb 28, 2018

@punker76

This comment has been minimized.

Contributor

punker76 commented Mar 26, 2018

@forki Here is a simple sample which shows this issue (error NU1202). A package should only be added in a higher framework, but it will be also added to the other ones:

VS 2017 15.6.4
R# 2017.3.5
Paket 5.153.2

The MaterialDesignThemes package should only be add for >= .NET45

JetBrains.Annotations
MahApps.Metro.IconPacks
MahApps.Metro

MaterialDesignThemes framework: >= net45

Bu the PaketMultiTargetingTest.csproj.net40.paket.resolved contains also the MaterialDesignThemes package.

ControlzEx,3.0.2.4,Transitive,Main,false
JetBrains.Annotations,11.1,Direct,Main,false
MahApps.Metro,1.6.1,Direct,Main,false
MahApps.Metro.IconPacks,2.1,Direct,Main,false
MaterialDesignColors,1.1.3,Transitive,Main,false
MaterialDesignThemes,2.4.0.1044,Direct,Main,false

2018-03-26_21h02_24

@forki forki closed this in 2268a0b Mar 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment