Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL create/use?

Status
Not open for further replies.

mjbosko

Programmer
Jun 26, 2002
248
US
I feel this is a bonehead question, but...

Is there a 'how to' on creating a middle-tier DLL somewhere for vb.net?

I'm taking my application to the next level - I want to break out some of my code into a dll - so that I can also use it with an ASP version.

I've never written a DLL before - where can I start to learn? I've searched MSDN, but wow - all I'm doing is weeding thru the unrelevant pages rather than learning.

Can someone point me in the right direction?

How can I write, and then use, a DLL in vb.net (enterprise).

Thanks!!!

Mike

 
Create a new solution.

Add a new project to your solution. Select "Class Library".

Right Click on the project and select Properties.

Enter a Root Namespace (will have defaulted to the name of the project)

Add a class to your project.

Write code for that class.

build solution.

There will now be a .DLL file in the App/bin folder.


Option 1:
Goto the project that you want to use the .DLL in.
Add a reference to the project.
Select the .Net tab.
Click Browse.
Select the DLL that you created in the Class Library.
Click OK.


Option 2:
Goto the solution that you want to use the .DLL in.
Add an existing project.
Select the project file from the Class Library you made.
Goto the project that you want to use the Class Library in.
Add a reference.
Select the Project Tab.
Select the Class Library.
Click OK.


to save yourself typing, at the top of any class that is going to reference the DLL type "Imports [Namespace]" where [Namespace] is the namespace of your Class Library.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top