question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet publish multi-targeting inferring incorrect versioning

See original GitHub issue

Description

I update FsToolkit.ErrorHandling from paket 6.2.1 to 7.1.5 (i’ve tried the alpha and as far down as 7.0) and there seems to be change with how multi-targeting works and having different versions for each.

Previously with 6.2.1 with a project a project with two TFMs <TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>

and two groups with different conditions

group NetStandard2
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.7.2
nuget Ply
nuget Hopac
nuget FSharp.Control.AsyncSeq
nuget Expecto
nuget Expecto.Hopac
nuget Microsoft.NET.Test.Sdk
nuget YoloDev.Expecto.TestSdk
nuget Fable.Mocha 2.12.0
framework: netstandard2.0, net5.0
storage: none
condition: netstandard2_0


group NetStandard2_1
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 6.0.3
nuget Hopac
nuget FSharp.Control.AsyncSeq
nuget Expecto
nuget Expecto.Hopac
nuget Microsoft.NET.Test.Sdk
nuget YoloDev.Expecto.TestSdk
nuget Fable.Mocha 2.12.0
nuget IcedTasks
storage: none
condition: netstandard2_1

I would get a nuspec file like:

    <dependencies>
      <group targetFramework=".NETStandard2.0">
        <dependency id="FSharp.Core" version="4.7.2" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard2.1">
        <dependency id="FSharp.Core" version="6.0.3" exclude="Build,Analyzers" />
      </group>
    </dependencies>

However after updating to 7.1.5 my nuspec file looks like:

group NetStandard2
source https://api.nuget.org/v3/index.json
nuget FSharp.Core >= 4.7.2
nuget Ply
nuget Hopac
nuget FSharp.Control.AsyncSeq
nuget Expecto
nuget Expecto.Hopac
nuget Microsoft.NET.Test.Sdk
nuget YoloDev.Expecto.TestSdk
nuget Fable.Mocha
nuget Fable.Core >= 4.0.0-theta-006
framework: netstandard2.0, net6.0
storage: none
condition: netstandard2_0


group NetStandard2_1
source https://api.nuget.org/v3/index.json
nuget FSharp.Core >= 7.0.0
nuget Hopac
nuget FSharp.Control.AsyncSeq
nuget Expecto
nuget Expecto.Hopac
nuget Microsoft.NET.Test.Sdk
nuget YoloDev.Expecto.TestSdk
nuget Fable.Mocha
nuget Fable.Core >= 4.0.0-theta-006
nuget IcedTasks >= 0.3.0
framework: netstandard2.1, net7.0
storage: none
condition: netstandard2_1
    <dependencies>
      <group targetFramework=".NETStandard2.0">
        <dependency id="FSharp.Core" version="4.7.2" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard2.1">
        <dependency id="FSharp.Core" version="4.7.2" exclude="Build,Analyzers" />
      </group>
    </dependencies>

Repro steps

Please provide the steps required to reproduce the problem

  1. Step A

  2. Step B

If possible then please create a git repository with a repro sample or attach a zip to the issue.

Expected behavior

Please provide a description of the behavior you expect.

Actual behavior

Please provide a description of the actual behavior you observe.

Known workarounds

Please provide a description of any known workarounds.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TheAngryByrdcommented, Nov 10, 2022

The changes in https://github.com/fsprojects/Paket/pull/3838 are what broke multi-targeting

0reactions
TheAngryByrdcommented, Nov 18, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Options for .NET's versioning issues | Jon Skeet's coding blog
This post revisits the problem described in Versioning Limitations in .NET, based on reactions to that post and a Twitter discussion which ...
Read more >
Build errors when multi-targeting in csproj file
To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework...
Read more >
.NET Versioning and Multi-Targeting - .NET 4.5 is an in- ...
The 4.5 update instead completely replaces the .NET 4.0 runtime and leaves the actual version number set at v4.0.30319. Rick has a great...
Read more >
Targeted .NET Frameworks - Visual Studio (Windows)
In Visual Studio, you can specify the version of .NET that you want your project to target. ... For more information, see Multitargeting....
Read more >
NET SDK error list - .NET CLI
A complete list of NETSDKxxxx errors, with links to more info where more info is available.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found