Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a DLL from my project in C# VS 2010
How can I do that?
please help me soon

Please help me!
Posted
Updated 27-Feb-11 21:36pm
v3
Comments
Albin Abel 28-Feb-11 2:33am    
A class library project compiled as a dll file.

Either create a class library project or just reference the exe file from another project. You can use all the public stuff from an exe just as you would have used them from a DLL.

Cheers!
 
Share this answer
 
v2
Comments
Abhinav S 28-Feb-11 3:04am    
Good answer.
Manfred Rudolf Bihy 28-Feb-11 3:08am    
Thanks!
Sergey Alexandrovich Kryukov 28-Feb-11 3:05am    
Manfred, I voted 5 mostly because you mentioned that you can reference any assembly, not only a library! I've written some more detail, please see.
--SA
Manfred Rudolf Bihy 28-Feb-11 3:09am    
Thank you!
A project has the option "Output type" (in Visual Studio, this is in the first tab of the properties, "Application"). The types are "Windows Application", "Console Application" and "Class Library". DLL is a "Class Library". You can change output type any time.

Note that the difference between type is not very essential. In principle, any application can play a role of the library: it can be added as a reference to any other .NET project. A library can be referenced by other Assembly by its main module (DLL file) using "Add Reference" => "Browse" or given a string name (signed), added to GAC and referenced by its name. In Visual Studio, it is important to setup project dependencies. The most convenient way is to reference a project from the same solution through "Add Reference" => "Projects" tab. In this case, project dependencies are set up automatically. Besides, you can change signature and/or version of referenced assembly at any time (for assembly referenced by its DLL file name a references should be removed and re-added).

Finally, assembly can be loaded dynamically using System.Reflection.Assembly.

—SA
 
Share this answer
 
Comments
Abhinav S 28-Feb-11 3:05am    
Nice answer.
Sergey Alexandrovich Kryukov 28-Feb-11 3:06am    
Thank you. How could you be so fast? :-)
--SA
Manfred Rudolf Bihy 28-Feb-11 3:12am    
Better elaboration than my answer! 5+
Thanks for the reminder about being able to change the output type in the project properties dialog. It's easy to forget if you never use it. :)
Sergey Alexandrovich Kryukov 28-Feb-11 3:23am    
Thank you very much.
Probably you never use the change because you thoroughly plan your steps :-)
But in highly experimental work, at the moment you move from prototyping to more permanent projects, this possibility can be quite handy.
--SA
RaviRanjanKr 28-Feb-11 3:47am    
Nice Answer SA. have a my 5
MSDN link here[^] (creating a Dll using the command line).
 
Share this answer
 
Comments
Manfred Rudolf Bihy 28-Feb-11 3:13am    
Useful link! 5+
Abhinav S 28-Feb-11 3:14am    
Thank you!
Sergey Alexandrovich Kryukov 28-Feb-11 3:37am    
Agree, my 5, too.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900