how can i create dll in c#.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MOHANLAL
    New Member
    • Oct 2006
    • 2

    how can i create dll in c#.net

    pls help me ...

    i would like to create a dll file in c#.net, how it possible? how to register the dll ?
    and whats the methode to use the dll in C#.net program?


    please help me


    thanks
    mohanlal
  • ushaimmadi
    New Member
    • Oct 2006
    • 1

    #2
    Automatically whenever u crate ur project the dll i stored in ur bin directory.
    In case if u need any dll to be added to ur project then follow these steps:

    1. In the Solution Explorer, right click on the references and select 'Add Reference'.

    2. Then Add Refernce dialog box is opened, there u need to browse the dll path and click select and then ok button.

    Now the dll is added. U can make use of that.

    Regards,
    Usha.

    Comment

    • bharathreddy
      New Member
      • Aug 2006
      • 116

      #3
      hai,

      In order to create your own dlls first open the VS then

      1)File->New->Project->then select the Class Library template.
      2)when opend u will find :

      using System;
      namespace ClassLibrary1
      {
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      public class Class1
      {
      public Class1()
      {
      //
      // TODO: Add constructor logic here
      }
      // Write your functions properties here.
      }
      }

      3) Build the solution. This will create the dll in the bin directory.
      4) Then in order to include this dll in your project follow the steps Usha had said above.

      Comment

      • fsc2006
        New Member
        • Sep 2006
        • 3

        #4
        HI
        I have one slight doubt about the same. Well what if i have already created program with 5-6 classes and all . And now i want to include it to .dll file so that i could use all the classes in another application..so is there any short cut method to do so or do i hv to start a new project to the same.
        thanks
        rnd

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by fsc2006
          HI
          I have one slight doubt about the same. Well what if i have already created program with 5-6 classes and all . And now i want to include it to .dll file so that i could use all the classes in another application..so is there any short cut method to do so or do i hv to start a new project to the same.
          thanks
          rnd
          Has your program been compiled as a DLL?
          What did you use to create your program?
          If you've used Visual Studio and created these classes in a Class Library project your DLL will be created whenever you build the project.

          If you haven't done this I would recommend making a new project and importing the classes into it.

          -Frinny

          Comment

          • bhar
            Banned
            New Member
            • Apr 2006
            • 37

            #6
            Hi,

            A class library is a collection of classes that are compiled into a .dll file. By converting classes into components we need not copy the source code into the projects where we need to use the components. We need to just import the component into a new project. By using components, we can reduce the size of the exe files. This is because components are precompiled and do not add up to the executable file. For those developing multiple projects, components provide scalability and performance to their applications.

            Answer to you question is: Better create a Class library project and inport your class methods and properties. More over you can use namespaces in your class library files.

            [Link Removed]
            Last edited by Frinavale; Apr 27 '07, 01:25 PM. Reason: emoving link to website advertising as this is considered spam

            Comment

            Working...