Imports don't work, compiling DLL .vb file

Results 1 to 3 of 3

Thread: Imports don't work, compiling DLL .vb file

  1. #1
    keith5000 Guest

    Default Imports don't work, compiling DLL .vb file

    Background:<BR>I&#039;m compiling a .vb file into a DLL to be placed into the /bin directory. The .vb file declares a namespace and a class. It imports the following namespaces at the beginning as follows:<BR><BR>Imports System<BR>Imports System.Data<BR>Imports System.Data.OleDb<BR><BR><BR>Problem:<BR>When I compile the .vb file ("vbc" command from dos command line), it tells me that "System.Data" and "System.Data.OleDb" cannot be found in the following error message:<BR><BR>"The Namespace or type &#039;Data&#039; for the Import &#039;System.Data&#039; cannot be found."<BR>(Same message for "System.Data.OleDb")<BR><BR><BR><BR>I&#039;ve tried compiling from different directories and changing the compilation arguments sent to "vbc" with no luck.<BR><BR>Any ideas?<BR><BR>Thanks in advance,<BR>Keith

  2. #2
    Join Date
    Dec 1969

    Default yes...

    ...i had that same problem when using some other namespaces<BR><BR>evidently, a lot of namespaces (and forgive me if my terminology isn&#039;t 100% correct - i&#039;m still fairly new to .net) were included in only one or two dll&#039;s in beta 2 - unlike in beta 1<BR><BR>try a command line like this:<BR><BR>vbc /t:library / MyVBFile.vb<BR><BR>i think the "" contains all of the namespaces you need to do what you want<BR><BR>this might also help you:

  3. #3
    keith5000 Guest

    Default got it! full solution inside...

    Thanks top ramen. You put me on the right track, there only needed to be a minor adjustment to your command line:<BR><BR>vbc /t:library /r:system.dll, MyVBFile.vb<BR><BR>Notice the addition of "system.dll" to the reference argument. This was included because of a namespace error about "System.ComponentModel.Component"<BR><BR><BR>K eith

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts