Micro Focus QTP (UFT) Forums
Calling dll C# in VBScript - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Calling dll C# in VBScript (/Thread-Calling-dll-C-in-VBScript)



Calling dll C# in VBScript - nacchio - 10-11-2011

Hi,

I have a C# dll in VS2010 like this:

Code:
namespace A
{
public class B
{
public int GetValue() { return 1; }
}
}

In QTP I added the following lines:

Code:
Set obj = DotNetFactory("A.B","C:\\path\\myLibrary.dll")
msgBox obj.GetValue()


When QTP run the first line of code it launchs this error:

"The format file "myLibrary.dll" is invalid"


How can I resolve it?


Thank in advance

Andrea