By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

regasm /codebase should not required

P: n/a
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

Jan 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

xamman wrote:
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.
<snip>

Didn't have any luck with this, also: it seems /codebase is
mandatory... =P

Regards,

Branco.

Jan 8 '07 #2

P: n/a


"xamman" <xa******@yahoo.comwrote in message
news:11*********************@11g2000cwr.googlegrou ps.com...
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 believe that when you use /codebase, it registers the location of the DLL
within the registry. So, what I would suggest, is if you don't want to use
/codebase, then once you use regasm on the dll, install the dll into the
global assembly cache (GAC). It *should* work, but I haven't tested it with
CScript.

HTH,
Mythran
Jan 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.