Class Library for use in VBScript

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
 
L

Leon Mayne [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top