dll in vb.net
I have 4 exe created in vb.net. I would like to use a vb.net dll. The regsvr32
said: no entry point.. I read a couple of threads and tried to register
with regasm, it was successfull, but the exe stops with Cannot create
ActiveX component. What's the problem, or whats the correct way to use
the dll?
AlanPosted Oct 2, 2007, 10:20 AM
I'm afraid not, Robert.
Unless you add a reference to the dll, you won't be able to compile your executable.
However, if you're looking for a way to deploy the whole thing as a single file, you could look at the free Microsoft utility ILMerge, which can be downloaded from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=22914587-B4AD-4EAE-87CF-B14AE6A939B0&displaylang=en
As the name suggests, this merges the exe and dll at the MSIL level into a single assembly. This, of course, means that you can continue to develop the exe and dll as separate code bases and only combine them at deployment time. However, you will still have to compile the exe by including the dll as a reference in the first place.
Robert MajzikPosted Oct 2, 2007, 6:53 AM
In vb6 i was able to use a dll (vb6 activex dll) without add to the references. (I registered with regsvr32). Is there any way to use a .net dll without adding it to the references?
AlanPosted Oct 2, 2007, 6:37 AM
If the dll has been created with VB.Net (as opposed to VB6) then it will be a .NET dll rather than an ActiveX or COM dll.
If this is the case, then all you need to do to use it from a VB.Net project is to add a reference to the dll. If the dll has a Namespace, I'd also add an Imports statement to your project so that you can use the class(es) in the dll without having to fully qualify them.