X
xamman
hi there, i am trying to use a .NET assembly from a Cscript.exe .vbs
(i.e. from COM)
and could not get my .vbs to use my .net dll (gives a 'file not found
error')
unless i used the /codebase parameter when registering .net dll with
regasm.
from what i read,a simple regasm dllname.dll and putting the dll and
cscript.exe in the same folder should be sufficient. /codebase should
not be required.
any other ideas what we could be doing wrong? thx
my original (more verbose) post is below, if required.
hi there! i have a .NET assembly which just generates a random number
rand.dll. i want to use it from a simple Cscript .vbs file using the
createobject vbs command which just instantiates & prints the chosen
number to screen. This requires COM.
A
thus I ticked COM interop in the build options for my class & copied
the Cscript.exe to my \bin folder where i have rand.dll so the
Cscript will be able to find the dll.
I did a regasm /tlb rand.dll & a regasm rand.dll and executed my .vbs .
It gave me a 'file not found error' obviously referring to the dll
which holds the class
B
then i ran regasm /codebase rand.dll and now the vbs executed.
I wanted to avoid using /codebase as I thought having the dll in the
same folder as the COM consumer Cscript would be sufficient. What did I
do wrong in A?
PS futher below is another persons post earlier this month with a
similar problem....
many thanks & Regards,
X
(i.e. from COM)
and could not get my .vbs to use my .net dll (gives a 'file not found
error')
unless i used the /codebase parameter when registering .net dll with
regasm.
from what i read,a simple regasm dllname.dll and putting the dll and
cscript.exe in the same folder should be sufficient. /codebase should
not be required.
any other ideas what we could be doing wrong? thx
my original (more verbose) post is below, if required.
hi there! i have a .NET assembly which just generates a random number
rand.dll. i want to use it from a simple Cscript .vbs file using the
createobject vbs command which just instantiates & prints the chosen
number to screen. This requires COM.
A
thus I ticked COM interop in the build options for my class & copied
the Cscript.exe to my \bin folder where i have rand.dll so the
Cscript will be able to find the dll.
I did a regasm /tlb rand.dll & a regasm rand.dll and executed my .vbs .
It gave me a 'file not found error' obviously referring to the dll
which holds the class
B
then i ran regasm /codebase rand.dll and now the vbs executed.
I wanted to avoid using /codebase as I thought having the dll in the
same folder as the COM consumer Cscript would be sufficient. What did I
do wrong in A?
PS futher below is another persons post earlier this month with a
similar problem....
many thanks & Regards,
X