Forum Discussion

mes6073's avatar
mes6073
Contributor
12 years ago

Question about CLR Bridge and c# versus VB.Net class libaries


Can anyone offer any insight why TestComplete's IDE imposes dashed notation when referencing class libraries compiled in VB.Net versus dotted namespace notation for the same class libraries compiled in c#? Referencing the Calling Functions From .NET Assemblies support article, I note the following:

"To call a specific method or property from scripts, use the following syntax:

 

dotNET.namespace.class.subclass.method(parameters)

dotNET.namespace.class.subclass.property(parameters)

As you can see, the namespace and class name (as well as the subclass name) must be separated by dots. Also, note that dots used in the namespace name must be replaced with an underscore character."



So that seems somewhat ambiguous as the example uses dotted notation and we have a set of .NET dll's originally written  in c# and recently ported to a VB.Net class library since many of our test team are not very fluent in c#. What is confusing is that when the c# libraries are added to the CLR Bridge, the Code Completion window presents dotted notation of the namespace and methods/properties. Conversely, when using the VB.Net equivalent libraries, the Code Completion window replaces the dots in the Namespaces with underscores which will force a significant amount of code edits/updates to use the VB.Net libraries.


1 Reply

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Michael, I use C# Libraries with JScript and all Namespaces are represented with underscores, e.g. dotNET.Jint_Parser_Ast.Program.zctor();

     


    Where:


    Jint_Parser_Ast = the Jint.Parser.Ast Namespace


    Program = the Program Class


    zctor() = the Constructor Method


     


    so I am not sure how you are able to use dot notation for referenced Namespaces.


     


    Regards,


    Phil Baird