PragmaticFlow / NBomber

Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
https://nbomber.com
Other
2.08k stars 129 forks source link

Could not load type 'System.Web.HttpContext' from assembly 'System.Web' #721

Closed Gnoocki closed 2 months ago

Gnoocki commented 3 months ago

Hello,

I'm trying to call C# methods of an assembly from my NBomber project. But I get the following error : Could not load type 'System.Web.HttpContext' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToke,=......' NBomber error assembly

This exception appears when calling the Step.Run function.

I think it's a compatibility issue. The assembly uses the .NET Framework 4.7.2 version and the test project uses the .NET 8.0 version and NBomber version 5.7.0.

Is there a solution to make NBomber work with this kind of assembly ?

AntyaDev commented 2 months ago

Hi, I think NBomber targets netstandard2.1. I think it is not compatible with .NET Framework 4.7.2

Gnoocki commented 2 months ago

Hi,

I discovered that a project in .NET standard version will never work with a project in .NET Framework version. In addition, it is not possible to install versions higher than 5 of NBomber in a project in .NET Framework version.

I managed to solve my problem by using the version 4.1.2 of NBomber which can be installed on a project in .NET Framework version.

But the downside is that we can't use recent versions of NBomber...