Class Library for use in VBScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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("MyLibrary.Utils")

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

Jesse
 
Jessard said:
How do I go about making a C# .NET class library available for use in
a VBScript file using something like?
Set mylib = CreateObject("MyLibrary.Utils")

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:
http://www.15seconds.com/issue/040723.htm
 
Back
Top