-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
System.IO.FileNotFoundException: Could not load file or assembly 'JasperFx.Core, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified #662
Comments
I managed to have a more detailed stacktrace:
However I wasn't able to reproduce the issue using a minimalist F# created from scratch, the below works in a blank project: // For more information see https://aka.ms/fsharp-console-apps
#nowarn "20"
open Microsoft.AspNetCore.Builder
open Oakton
open Oakton.Resources
let exitCode = 0
[<EntryPoint>]
let main args =
printfn "Hello from F#"
let builder = WebApplication.CreateBuilder(args)
builder.Host.ApplyOaktonExtensions()
builder.Services.AddResourceSetupOnStartup()
let app = builder.Build()
app.RunOaktonCommands(args) |> Async.AwaitTask
exitCode
I am trying to figure out what's going on in my main project, nothing looks suspicious in the .fsproj file and the versions of the nuget packages referenced seem to be consistent: |
Progressing! Turns out this is actually a Wolverine issue. I managed to reproduce the issue by adding the Wolverine package to the minimal project. As soon as I did that the exception appeared on startup. So here is the situation:
I have been able to fix this problem by upgrading Wolverine packages from version 1.10.1 to the latest version (1.12.4). However what is strange is that these issues did not occur in the C# project (when porting to F# I just kept the same versions of the NuGet packages). I'll therefore leave this issue open for a bit so that hopefully the root cause can be identified lest the problem pops up again randomly during a minor package version update. |
Jasper is the old name for Wolverine, and that is no longer maintained as that became Wolverine. JasperFx.Core is a shared library used by Marten, Wolverine, and others that is actively maintained. This sounds like a run of the mill Nuget reference problem which unfortunately happens quite often with projects that are moving. If you were on the latest Wolverine or Oakton, both are forcing you to the latest JasperFx.Core, which should knock out the problem. There's nothing actionable here, so I am closing this one. |
Describe the bug
I do not know if the JasperFx.Core project is still being maintained since it has had no activity in over a year, and the description says that Wolverine is its successor, I therefore repost this issue here and apologize if this is not appropriate.
When running a basic empty ASP.NET Core project in F# configured to use a library calling JasperFx under the hoods (Oakton, Wolverine, etc...) I get the following exception on application startup:
What is strange is that the dll is correctly copied to the output directory, however its metadata are a bit strange: namely the version is set to 0.0.0.0, here is what JetBrains Rider displays about the assembly referenced by the project
Needless to say that this issue is quite blocking, running a project with something as basic as the below should reproduce the exception:
If I remove the lines regarding oakton and try to configure Wolverine using the UseWolverine method of the hostbuilder, this exception will be thrown at that point instead. I've seen people succefully boostrap JasperFx-based projects using F# like here so I'm a bit puzzled.
Everything works properly in the C# version but I am in the process of migrating all the projects to F#. Any idea or pointers? Cleaning/Rebuilding does not help unfortunately. The project targets .NET 7:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The application is launched
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: