FsToolkit.ErrorHandling icon indicating copy to clipboard operation
FsToolkit.ErrorHandling copied to clipboard

Worried about the Diamond dependency problem

Open TheAngryByrd opened this issue 3 years ago • 6 comments
trafficstars

Is your feature request related to a problem? Please describe.

I'm worried about diamond dependencies with this project. As it grows more popular, more things will start relying on it and start causing conflicts with consumers.

For example, seeing packages constraining the upper limit can possibly slow adoption.

image

Describe the solution you'd like

Since this is just a pile of functions without much in the way of dependencies usually, it might want to explore this Source package approach.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

TheAngryByrd avatar Oct 20 '22 14:10 TheAngryByrd

I'm currently struggling with the following error, might that be caused by exactly what you're describing here?

System.TypeLoadException : Could not load type 'TaskResultBuilder' from assembly 'FsToolkit.ErrorHandling.TaskResult, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null'.

abelbraaksma avatar Nov 01 '22 17:11 abelbraaksma

Possibly? Might need more context. Could also be missing the DLL in the directory of where ever you are running.

TheAngryByrd avatar Nov 01 '22 17:11 TheAngryByrd

Well, I’m still investigating. It happens with dotnet test. Failed after updating from 2.x. It first complained about Pky not being there, which was implicit and not a problem before, so I added it manually. Then it gave the above error.

However, same solution on one system succeeds, in CI it succeeds, but not on mine, not on one other. All systems had the Ply error, but only some have the above. Even after cleaning/clearing caches etc. Still investigating. Will let you know, but may be hard to make a small repo.

Oh, also surprising, some functions that do use TaskResult, succeed. Some others fail.

abelbraaksma avatar Nov 01 '22 21:11 abelbraaksma

It may be a dependency that itself uses F# task, and somehow this conflicts. But still, why it’s differently behaving per system is weird.

abelbraaksma avatar Nov 01 '22 21:11 abelbraaksma

Meanwhile sorted it out. The problem was caused by some functions using helpers from our own Nuget package store that in turn used a 2.x FsToolkit. Upgrading that package to use the newer FsToolkit solved the issue.

My guess is that a conflict arose with these functions defaulting to Ply tasks, which ultimately caused a runtime error. Why it wasn't caught as a compile time error, I don't know.

I tried to create a minimal repro, but each time I dumbed it down, it "just worked".

abelbraaksma avatar Nov 03 '22 15:11 abelbraaksma

I got the same issue: System.TypeLoadException: Could not load type 'TaskResultBuilder' from assembly 'FsToolkit.ErrorHandling.TaskResult, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'

After updating from the 2.3.1 version, I see this runtime error. It happens only in build Debug (I don't see it in the Release). Also I tried to add: <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> But it doesn't help.

AntyaDev avatar Dec 03 '22 08:12 AntyaDev