Blog
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    APIs
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
 

Home >> C# >> Creating dll in c#.
Creating dll in c#.

In this blog I will tell you that how to create dll's in c# by using notepad and visual studio command prompt.
Views: 2673     Comments: 0
by Awadhendra Tiwari on 6/13/2011

In this blog I will tell you that how to create dll in c# by using notepad and visual studio command prompt. Here I will provide you a sample algorithm which is helpful for you while creating dll in c#.

1)      Create a class for which you want to create a dll. Like following example will be demonstrate a sample class.
/*

                This is a program which give you a demonstration that how to

                make a dll in c# using notepad and visual studio command prompt.

*/

using System;   //A basic namespace which is required for c# program.

public class Employee

{

                public void disp()

                {

                                Console.WriteLine("This is sample dll created by notepad and c# compiler.");

                }             

}

 

2)      Save this class in a file by using valid filename. I had save this file by using Employee.cs for this demonstration.

3)      Now compile this file by using following syntax.

               csc  /target:library Employee.cs

               This will create a dll for Employee class. Here target:library will denotes that a dll should be      created after compilation.

4)      Now create another file in which create a TestEmployee named class which used this dll. Following example will demonstrate use of this class.

/*

                This is a sample program which will execute

                Employee.dll

*/

using System;

public class TestEmployee

{

                public static void Main()

                {

                                Console.WriteLine("Testing of Employee.dll begins....");

                                Employee emp=new Employee();   //Create an object of Employee class.

                                emp.disp();                    //Call disp() method of Employee class.

                                Console.WriteLine("Testing of Employee.dll ends....");

                }

}

 

5)      Save this file by using TestEmployee.cs .

6)      Compile this file by using following syntax.

               csc  /reference:Employee.dll  TestEmployee.cs

Here reference word tells that Employee.dll is added in program before compiling.

7)      Now execute program by writing TextEmployee.exe and see the output.

Title :  
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
       
 
Report Abuse Form
Reason:    
 
Latest ArticleRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest Blogs by Awadhendra TiwariRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 5648
  
Copyright © 2013MindStick. All Rights Reserved.