Skip to content
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

Simple dotnet publish fails with duplicate FSharp.Core.xml error #4149

Open
jwosty opened this issue May 13, 2022 · 4 comments
Open

Simple dotnet publish fails with duplicate FSharp.Core.xml error #4149

jwosty opened this issue May 13, 2022 · 4 comments

Comments

@jwosty
Copy link

jwosty commented May 13, 2022

Description

Given two projects, a netstandard2.0 library and a net6.0 entry point project, dotnet publish freaks out. Not sure if this is a paket issue, an FSharp.Core issue, or a dotnet SDK issue. I'll start it here for now -- I am happy to file this elsewhere if it's not paket's fault.

Repro steps

Please provide the steps required to reproduce the problem

  1. Create A.fsproj (netstandard2.0) and B.fsproj (net6.0)
  2. Make B reference A
  3. Run the app and observe that this works
  4. Attempt to dotnet publish the app and watch it explode

Repro zip: ConsoleApp.zip

Expected behavior

We get a published output.

Actual behavior

We get the following error:

C:\Program Files\dotnet\sdk\7.0.100-preview.2.22153.17\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: C:\Users\jwost\.nuget\packages\fsharp.core\6.0.4\contentFiles\any\netstandard2.0\FSharp.Core.xml, C:\Users\jwost \.nuget\packages\fsharp.core\6.0.4\contentFiles\any\netstandard2.1\FSharp.Core.xml. [C:\Users\jwost\source\repos\ConsoleApp\ConsoleApp\ConsoleApp.fsproj]

(Yes, I have .net 7 preview installed, but it still happens on CI with only .net 6 installed)

More info

content: none from dotnet/fsharp#11143 does not appear to help.

Known workarounds

  • Downgrade to FSharp.Core 5.0.2 or earlier (6.0.0 is the first version broken in this way)
  • OR Make the library target netstandard2.1, though this prevents you from referencing it from a .net framework project
  • OR Multi-target the actual platforms your endpoint projects are targeting (e.g. .net 6 + .net framework 4 in my case) - haven't tried this, but I'm sure it would work
@baronfel
Copy link
Contributor

Simple workaround is to set content: none for the fsharp.core reference. This particular packaging choice is something I've been going back and forth with Kevin on for quite a while.

When using nuget directly, the .net SDK also had to handle this.

@baronfel
Copy link
Contributor

baronfel commented May 13, 2022

Wait, you claim that content: none doesn't work. Hmmm.

@jwosty
Copy link
Author

jwosty commented May 13, 2022

Yeah. I tried it both just for the package and globally in paket.dependencies.

@jwosty
Copy link
Author

jwosty commented Jun 16, 2022

Anyone know of a workaround that allows me to use a recent FSharp.Core? This is causing me some major headaches with my app right now. Finding combinations of things in my dependency web that work is starting to get very tricky. @forki or @KevinRansom got any tips perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants