[Runtime Error] System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=8.0.0.0 #8
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: bit-badger/Giraffe.Htmx#8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hey all, love the package but can't seem to get it to work.
Context
Using in simple page:
Problem
So my app builds fine but when I try to actually use one of these
Giraffe.ViewEngine.Htmx
imports it fails at runtime with this error:I can reproduce this by trying to use any of these imports like this:
Hypothesis
I think I'm missing Fsharp.Core 8 so this may just be a me problem. But it seems odd that I can DL and use this package without any errors being thrown until runtime.
Also, I can't seem to update my Fsharp.Core to 8. I'm wondering if Fsharp 8 requires dotnet 8 so this package says it can run on dotnet 6 and 7 but actually requires 8?
idk.
Q1: Any ideas as to how this happened / ways to fix?
Q2: Any ways to prevent this from happening in the future?
Let me see if I can duplicate it. I thought the deps in the package would handle that if it's listed, or that NuGet would complain if it couldn't resolve it on its own. Thanks for reporting this!
There are a couple of things you can try:
<PacakgeReference Update="FSharp.Core" Version="8.0.100" />
I'm investigating some conditional build dependencies, where I could reference a specific version of
FSharp.Core
based on the target framework. I'll leave this open and associate whatever the fix is here, so you'll know when it's ready.p.s. Sorry for the delay on this - day job has been crazy!
Two paths here that I can see:
@danieljsummers is the multitargeting necessary for this library? Are you doing anything with the net7.0 and net8.0 targets at all in the codebase? If not, then you could go back down to a net6.0 target only and use
<PackageReference Update="FSharp.Core" Version="6.0.0" />
in your .fsproj to pin the library to the .NET 6-compatible version of FSharp.Core. This lowest-compatible version specification is what library authors should do (since your lib isn't actually using FSharp.Core until runtime, you can let consuming Apps decide what version that want to bring, so long as it's at least FSharp.Core 6.0.0).if you are doing something specific for .NET 7 and/or .NET 8, then you'll need to make your
<PackageReference Update=
items conditional on the TFM, but still at the earliest version of FSharp.Core for each TFM. That would look like this:Note that I really don't suggest this unless you're using some functionality introduced in .NET7/.NET8 in this library for each of those TFMs (i.e. new BCL APIs, new F# syntax like the F# 8 improved interpolation syntax, etc).