-
Notifications
You must be signed in to change notification settings - Fork 525
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
NewSdk and MultiTargeting and Conditions #2596
Comments
First: You need to add a condition to your group. |
Hm, do you know of another way to solve this? Or should I just use nuget? |
@matthid why don't we support such conditions? What is missing? |
This is seriously a fucked up situation with fsharp.core. |
eirik had two requirements for any change: need to target net35 and need to target FSharp.Core <= 3.1 Unfortunately, you can't build against netstandard with FSharp.Core 3.1. I was trying to resurrect fsprojects/Argu#74 (comment) |
Yes that's completely broken now. /cc @KevinRansom
Am 10.08.2017 11:42 vorm. schrieb "Lukas Rieger" <[email protected]>:
… eirik had two requirements for any change: need to target net35 and need
to target FSharp.Core <= 3.1
Unfortunately, you can't build against netstandard with FSharp.Core 3.1.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2596 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNNdKrF3Z_pSeZ5YHZV3QGYCjqQjWks5sWtCdgaJpZM4Oy1tL>
.
|
Hm, I don't think this is the fault of fsc. FSharp.Core 3.1 just doesn't contain a valid version for netstandard. |
One temporary workaround could be to use two project files and build/pack
them both. Afterwards you can use nuget's merge task to merge the nupkgs.
But we should really make the framework restricted work.
Am 10.08.2017 11:44 vorm. schrieb "Steffen Forkmann" <[email protected]>:
… Yes that's completely broken now. /cc @KevinRansom
Am 10.08.2017 11:42 vorm. schrieb "Lukas Rieger" ***@***.***
>:
> eirik had two requirements for any change: need to target net35 and need
> to target FSharp.Core <= 3.1
>
> Unfortunately, you can't build against netstandard with FSharp.Core 3.1.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#2596 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AADgNNdKrF3Z_pSeZ5YHZV3QGYCjqQjWks5sWtCdgaJpZM4Oy1tL>
> .
>
|
Yes. afaik that's how it is currently done. But then it may be easier to just use nuget directly and |
Maybe you could try to help with making the restrictions work by adding some tests? . I don't think it's too much missing. |
I was talking about conditions not restrictions which is a entirely different feature. Problem wirh restrictions are that we never resolve different versions... We cannot really detect that a package no longer supports a particular framework. so you can never resolve a different fsharp.core without help of the user |
So ... I expected this to work:
However it fails with this output:
As you can see I specifically disabled the automagic package reference to System.ValueTuple even if it did that should find a much higher version than 4.3.0. I hypothesize that nuget restore is verifying:
We don't have that in the 4.1.x nuget package that we build in our build. I haven't deployed a 4.1.18 nuget package but I could if the community is happy that we make this change. It will break builds who are reliant on referencing fsharp.core 4.1.17 pulling down the system.valuetuple nuget package. So ... I tried it out with a local copy of the 4.1.18 version of the package and it worked fine:
Should I publish 4.1.18 without the dependence on System.ValueTuple.dll? Kevin |
@KevinRansom Thanks!
Can you please try if
Yes, I think it would be good to have a version of FSharp.Core that can be used to target everything from netfx3.5 to netstandard2.0 Edit: this works (ref dotnet/msbuild#1333 (comment)) <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net35;netstandard1.6</TargetFrameworks>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="3.0.2" Condition=" '$(TargetFramework)' == 'net35' " />
<PackageReference Include="FSharp.Core" Version="4.2.2" Condition=" '$(TargetFramework)' != 'net35' " />
</ItemGroup>
<ItemGroup>
<Compile Include="Library.fs" />
</ItemGroup>
</Project> And generates a (at first glance) correct nupkg:
|
I think we could "fix" this is we generate a real "MSbuild" file with the actual |
I think I would rather implement #2606, so that the user can condition the |
Ok go ahead :). I think it might be asking for a lot more trouble than you think (depending on how we implement it - obviously you could just use them as marker and let msbuild ignore them completely) |
hm, my idea was to just pass them as commandline parameters to paket here: https://github.com/fsprojects/Paket/compare/master...0x53A:paket-references-xml?expand=1#diff-c17f23be41fa3f5b94dff83d2c955208R24 That means you can use them almost exactly like "PackageReference", including making them conditional, or adding them via some Directory.Build.props, etc. |
I changed that process a bit :) |
Closing. dupe of #2394 |
I need to multitarget
<TargetFrameworks>netstandard1.6;net40;net35</TargetFrameworks>
.For net35 / net40, I need to reference FSharp.Core 3.1.
For ns16 I need to reference a higher version, currently I was thinking about just taking 4.2.2.
I tried to use conditions for this:
dotnet restore
now fails with:Q: Is what I want even possible?
The text was updated successfully, but these errors were encountered: