Imports don't work, compiling DLL .vb file

MzP18

New Member
Background:<BR>I'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 'Data' for the Import 'System.Data' cannot be found."<BR>(Same message for "System.Data.OleDb")<BR><BR><BR><BR>I'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...i had that same problem when using some other namespaces<BR><BR>evidently, a lot of namespaces (and forgive me if my terminology isn't 100% correct - i'm still fairly new to .net) were included in only one or two dll's in beta 2 - unlike in beta 1<BR><BR>try a command line like this:<BR><BR>vbc /t:library /r:system.data.dll MyVBFile.vb<BR><BR>i think the "system.data.dll" contains all of the namespaces you need to do what you want<BR><BR>this might also help you: http://www.gotdotnet.com/beta2/change.aspxThanks 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,system.data.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>Keith
 
Back
Top