Highlighted
New Member.
2045 views

How to call a method from .net DLL in LoadRunner

I have a LoadRunner script in which I want to call a method that is written in .net DLL. I tried lr_load_dll function but methods are not available after that.

0 Likes
3 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to call a method from .net DLL in LoadRunner

Hi

Yes, lr_load_dll() is the function to use.

How do you mean that the methods is not available. If you mean that they are not available through syntax completions, they will never be, you need to know how to call them. Or do you experience some kind of error message, then share it.

The dll must be available during runtime. By placing the dll in the LoadRunner/include folder it will always be.

br /ola


Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.

.
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: How to call a method from .net DLL in LoadRunner

Hello,

The lr_load_dll() is used in C language script, it will call the LoadLibrary() API on Windows and is running in Native context. As the .net dll is running in Managed context,  there will be a common question as Call managed dll from native C++, you can refer to this MS page:

 https://support.microsoft.com/en-us/help/828736/how-to-call-a-managed-dll-from-native-visual-c-code-in-visual-studio.net-or-in-visual-studio-2005.

If you want to use other language / Protocol, e.g. the .Net Protocol,  we’ll help to forward the question to the related team.

Regards,

Bingle(LoadRunner R&D)

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: How to call a method from .net DLL in LoadRunner

I did not understand the last post. How do you actually call a function from a dll if you are a .net virtual user. Is simply putting the dll in the include folder enough?  I did that and LR did not recognized one of my function calls from the dll. I have .net 4.5 installed.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.