Easy dll using in Visual Studio


Hello again

Today I will show how to use a .dll  file using Visual Studio. dll is nothing but the a complied managed code by .NET CLR (at least for this tutorial).

what I did is just wrote a simple class “Employee” in a new project named “EmployeeInformation”. It has one property and a method jest to show that how to build a dll of a class and use it in another project.

Now i have build the class by right clicking over the project named “EmployeeInformation” and pressing build, For me a dll has been generated in “C:\Users\MD.Tanvir Anowar\Documents\Visual Studio 2008\Projects\RefTest\EmployeeInformation\bin\Debug\” directory named “EmployeeInformation.dll” you may found it in your Output panel at the bellow of VS after build the project.

Now I have to let the dll know by my main project “RefTest”, to do this i have to right click on my “RefTest” project and Click over Add Reference .

Now i have to browse and select the “EmployeeInformation.dll”

to user the dll now we have to instantiate the class in our main porject’s class by typing:

EmployeeInformation.Employee employee = new EmployeeInformation.Employee();

now in employee object we will get the our desire property of the class as following

Thank you.

,

Leave a Reply