Class Library for use in VBScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jessard

    #1

    Class Library for use in VBScript

    Hi all,

    How do I go about making a C# .NET class library available for use in a
    VBScript file using something like?

    Set mylib = CreateObject("M yLibrary.Utils" )

    Surely it must be able to be done without too much fuss.

    Jesse
  • Leon Mayne [MVP]

    #2
    Re: Class Library for use in VBScript

    Jessard wrote:[color=blue]
    > How do I go about making a C# .NET class library available for use in
    > a VBScript file using something like?
    > Set mylib = CreateObject("M yLibrary.Utils" )[/color]

    Firstly, you need to make sure the class library is registered for com
    interop. You can do this manually, but it's easier to create a new COM class
    (project / add component / COM class) and move all your existing stuff into
    there. You need to check things in the assemblyinfo file such as versioning,
    and turn off automatic versioning to make things easier later, and you have
    to create a strong name for the project (see the link below). You then
    compile the dll and use it how you like. It's best to install it in the
    global assembly cache so you can just use VBScript's CreateObject function.

    More info about all the above steps here:



    Comment

    Working...