fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
1.99k stars 520 forks source link

All FSharp.Core redirects removed after updating to FSharp.Core 5.0.0 #3961

Open vasily-kirichenko opened 3 years ago

vasily-kirichenko commented 3 years ago

paket update FSharp.Core

The expected change in paket.lock:

image

But all the redirects (in ~150 projects) are gone:

image

which results with runtime errors, like this:

System.TypeInitializationException : The type initializer for 'xxx' threw an exception.
  ----> System.TypeInitializationException : The type initializer for '<StartupCode$xxx>.$Settings' threw an exception.
  ----> System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The header of paket.dependencies is:

redirects: on
framework: net462
source ./nuget
source https://api.nuget.org/v3/index.json
forki commented 3 years ago

Did you try redirects: force for FSharp.Core package?

5.0 changed their /libs quite dramatically. Not sure anyone tested that with net462 yet.

Vasily Kirichenko notifications@github.com schrieb am Di., 1. Dez. 2020, 07:40:

paket update FSharp.Core

The expected change in paket.lock:

[image: image] https://user-images.githubusercontent.com/873919/100705718-c0686c00-33b8-11eb-8b2b-82161de09d1d.png

But all the redirects (in ~150 projects) are gone:

[image: image] https://user-images.githubusercontent.com/873919/100705559-6d8eb480-33b8-11eb-8ed8-06fb5c6b9a69.png

which results with runtime errors, like this:

System.TypeInitializationException : The type initializer for 'xxx' threw an exception. ----> System.TypeInitializationException : The type initializer for '<StartupCode$xxx>.$Settings' threw an exception. ----> System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The header of paket.dependencies is:

redirects: on framework: net462 source ./nuget source https://api.nuget.org/v3/index.json

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/3961, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANB4SSWT6SIERUJR4ETSSSFWJANCNFSM4UISQZ4A .

vasily-kirichenko commented 3 years ago

@forki Yes, I've tried redirects: force, no effect.

What I need is just to add the redirection for FSharp.Core to version 5.0.0 to all app.configs. Is it possible?

I cannot see how the structure of the package's /libs or the target framework could break it :(

forki commented 3 years ago

do you have a simple repro with just one project as a zip? I would look at it asap

vasily-kirichenko commented 3 years ago

@forki https://github.com/vasily-kirichenko/FSharpCore5PaketRedirectionBug (or you really need a zip?..)

forki commented 3 years ago

Ok I looked at it. As I expected it's the change in /lib folder. The new FSharp.Core 5.0 only comes with netstandard2.0 support.

And netstandard2.0 and net462 don't really fit together. Short story: If we activate the compatibilty in Paket then stuff breaks. If we don't then scenarios like this one here doesn't work.

There is a PR by @0x53A which tries to mitigate this. see https://github.com/fsprojects/Paket/pull/3447 - it also gives a lot more details on the history. Funnily one of those mentioned issues is by you. So you already run into this before.

@0x53A any ideas why we dropped the ball here?

vasily-kirichenko commented 3 years ago

@forki I've created net462 dir, copied netstandard2.0 dir's content into it, zip all this into 5.0.1 package and use it locally. Problem solved, Microsoft, thank you, as always! :)

forki commented 3 years ago

Lol yeah I guess that will make it work :P

Vasily Kirichenko notifications@github.com schrieb am Di., 1. Dez. 2020, 21:04:

@forki https://github.com/forki I've created net462 dir, copied netstandard2.0 dir's content into it, zip all this into 5.0.1 package and use it locally. Problem solved, Microsoft, thank you, as always! :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/3961#issuecomment-736786593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANFOZGLVTA7EDXBDXFLSSVD5JANCNFSM4UISQZ4A .

0x53A commented 3 years ago

@forki I didn't have the time and motivation to finish it, and by now I've migrated to .net 5 ¯\_(ツ)_/¯