Skip to content

Init scenario error: 'System.TypeLoadException: Could not load type 'FsToolkit.ErrorHandling.TaskResultCE' #591

@anpin

Description

@anpin

Hi, I'm unable to run NBomber in NUnit F# project if it has dependency on FsToolkit.ErrorHandling.TaskResult package. The error message is:

18:18:22 [ERR] Init scenario error: 'System.TypeLoadException: Could not load type 
'FsToolkit.ErrorHandling.TaskResultCE' from assembly 
'FsToolkit.ErrorHandling.TaskResult, Version=4.6.0.0, Culture=neutral, 
PublicKeyToken=null'.
   at NBomber.DomainServices.TestHost.WorkerPlugins.init@16-1.Invoke(Unit 
unitVar)
   at Ply.TplPrimitives.tryWith[u](FSharpFunc`2 continuation, FSharpFunc`2 
catch)'

here is quick fsi repro

#r "nuget: NBomber"
#r "nuget: FsToolkit.ErrorHandling.TaskResult"
#r "nuget: Ply"
open System
open System.Threading.Tasks
open NBomber.FSharp
open NBomber.Contracts
open FsToolkit.ErrorHandling
open Serilog.Events

Scenario.create("load-test", fun ctx -> task {
    do! Task.Delay(100)
    return Response.ok ()
})
|> Scenario.withoutWarmUp
|> Scenario.withLoadSimulations [ KeepConstant(1, TimeSpan.FromSeconds(10)) ]
|> NBomberRunner.registerScenario
|> NBomberRunner.withMinimumLogLevel LogEventLevel.Debug
|> NBomberRunner.run

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions