Compile error when using reference to own dll

  • Thread starter Carles Vela i Aulesa
  • Start date
C

Carles Vela i Aulesa

Hi,
I have a problem when I am trying to compile the .vb assembly to dll
in VB studio 2005 Express Edition.

I have my onw dll, which looks like:

Public Class CL1
Public Shared Function FN1(...) As String
...
End Function
End Class
(in .vb format)

and I have another assembly, in which I have an reference to my
previous dll

Imports CL1
Public Class CL2
Public Shared Function FN2(...) As String
...
End Function
End Class

In VB studio 2005 I created an reference to my dll assembly and all
works fine, but when
I try to create an dll from saved .vb file (vbc.exe /target:library c:
\CL2.vb) I got an error:

Warning: BC40056: Namespace or type specified in the Imports
'DotNetNuke.Services.Upgrade' doesn't contain any public member or
cannot be found. Make sure the namespace or the type is defined and
contains at least one public member. Make sure the imported element
name doesn't use any aliases.

Could someone help how to create the dll file with reference to my own
dll?

Thanks a lot.

Jitsu
 
J

Jesse Houwing

* Carles Vela i Aulesa wrote, On 29-6-2007 17:24:
Hi,
I have a problem when I am trying to compile the .vb assembly to dll
in VB studio 2005 Express Edition.

I have my onw dll, which looks like:

Public Class CL1
Public Shared Function FN1(...) As String
...
End Function
End Class
(in .vb format)

and I have another assembly, in which I have an reference to my
previous dll

Imports CL1
Public Class CL2
Public Shared Function FN2(...) As String
...
End Function
End Class

In VB studio 2005 I created an reference to my dll assembly and all
works fine, but when
I try to create an dll from saved .vb file (vbc.exe /target:library c:
\CL2.vb) I got an error:

Warning: BC40056: Namespace or type specified in the Imports
'DotNetNuke.Services.Upgrade' doesn't contain any public member or
cannot be found. Make sure the namespace or the type is defined and
contains at least one public member. Make sure the imported element
name doesn't use any aliases.

Could someone help how to create the dll file with reference to my own
dll?

Thanks a lot.

Jitsu

You need to specify which libraries you're linking to when compiling
from the command line. I'm a C# guy, so I don't know the vb syntax for
this by heart. But vbc /? should get you started.

Jesse
 
C

Carles Vela i Aulesa

Many thanks Jesse,
You were right! :)

So the correct command is:

vbc.exe /target:library c:\CL2.vb /r:C:\CL1.dll

or in case of more dll:

vbc.exe /target:library c:\CL2.vb /r:C:\CL1.dll,C:\CL1a.dll,C:
\CL1b.dll

Thanks ;)

Jitsu
 

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