.NET+ protocol
The VuGen .NET+ (DotNetPlus) protocol is used to create scripts that emulate users of Microsoft .NET client applications created in .NET 6.
Note: The VuGen .NET+ protocol is available from VuGen 2022 R2.
In this topic:
.NET+ protocol overview
.NET+ Vuser scripts are coded manually in C#. There is no record option.
The .NET+ protocol enables you to load test by replaying the application’s method calls.
Note:
Although .NET-based and Java protocols support creating threads, we recommend that you do not use background threads in real load testing scenarios because:
-
Threads can degrade tests scalability.
-
Threads can affect performance measurements.
-
The utility functions' behavior is undetermined if called from any thread except the Vuser main thread which runs the vuser_init, Action, and vuser_end actions. This applies to all functions named lr*.
Manually create a .NET+ script
You can manually code .NET+ scripts in the VuGen editor, or from Visual Studio.
For information on creating and coding scripts, see Code a .NET script.
For information on editing in Visual Studio, see Create and View Vuser Scripts in Visual Studio.
Note: The following restrictions currently apply for .NET+ scripts:
-
There are no Visual Studio add-ins or templates.
-
Breakpoints, step-by-step mode, and code autocomplete are not supported.
To manually create and edit a .NET+ script:
-
Prerequisites:
-
Download and install the Microsoft .NET 6 SDK.
-
If you are using Visual Studio, make sure a supported version is installed. For details, see the Supported Protocols .
-
-
In VuGen, in the Create a New Script dialog box, open a new .NET+ script.
-
Open the Runtime Settings window and define the settings for your script. Use the following pages to define how to work with .NET:
-
Dotnet Settings. Define the path to the .NET SDK executable, and the path to any additional build parameters you want to use.
-
Package References. Add NuGet packages for referenced DLLs.
-
Local References. Add local referenced DLLs.
Note:
-
You can add COM reference dependencies from Visual Studio only, not from VuGen Runtime Settings.
-
Script replay is supported on 32 and 64-bit. For 64-bit, in Runtime Settings > Miscellaneous, select Replay script with 64-bit.
-
-
-
Insert your code into the script. .NET+ supports all the .NET functions. For details, see the Function Reference (select the relevant version).
Tip: To open and edit the script in Visual Studio, click the
button on the toolbar.
You can include methods returning a dataset, data table, or data reader action, and VuGen generates a grid for displaying the data. For details, see View data sets and grids.
Replay limitations
The following limitations apply for replay of a .NET+ Vuser script:
- Exceptions in .NET+ scripts generated by vts functions, may cause the replay to abort, even when the Continue on error runtime setting is enabled.
Workaround: Usetry
andcatch
statements for error handling of the vts functions. - .NET+ scripts that contain UI objects can behave unexpectedly during replay in VuGen, Controller, or on a load generator machine.
See also: