Re: Class vs. DLL
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Wed, 13 Aug 2008 00:21:13 +0200
Paolo wrote:
Learning C# using Console applications. I want to develop some utility functions (wrapping up some of the Console class methods) so that I can have them available for any program that I write.
If I create a DLL do I include these functions by adding it as a reference in my projects?
If I create a Class do I add the 'using' directive to include them?
Are there any pros/cons with respect to either approach?
Thanks
You can create a new project in the solution and create one or more classes in it. This will then be compiled into a separate dll. To use the classes from the application you need to add a reference to the project.
To use the classes in another solution, you can either add the project to the solution and add a reference to the project, or add a reference to the compiled dll file.
(Of course you can also develop the project separately in it's own solution.)
If a class is in a different namespace (which it usually would be if it's in a separate project), you either can use a using directive to import the namespace or specify the full class name (i.e. namespace.classname) everytime you use the class.
--
Göran Andersson
_____
http://www.guffa.com
.
- Follow-Ups:
- Re: Class vs. DLL
- From: Paolo
- Re: Class vs. DLL
- References:
- Class vs. DLL
- From: Paolo
- Class vs. DLL
- Prev by Date: Class vs. DLL
- Next by Date: Re: Class vs. DLL
- Previous by thread: Class vs. DLL
- Next by thread: Re: Class vs. DLL
- Index(es):
Relevant Pages
|