Accessing namespaces

S

SC

Hi,

I am starting with C# and I built a couple of classes,
each in their own .cs files and each in their own
namespaces, that I would like to be accessible in all my
projects.

Basically, I'd like to compile them, store them somewhere
on my hard drive and be able to use the "using" keyword
followed by my namespace.

How can I do this? How do I compile such classes
(without any main functions and/or real entry points) and
how can I make them accessible by all my projects?

Plus, if any of you guys can help me setup my environment
so that I can just open the project with the classes,
modify them and just recompile them without having to
move them again or to register something it would be
great.

Thanks a lot,

SC
 
G

gabriel

Read the docs, look into "class libraries." Those are exactly what you
want. Too long to fully explain here.
 
G

gabriel

SC said:
Plus, if any of you guys can help me setup my environment
so that I can just open the project with the classes,
modify them and just recompile them without having to
move them again or to register something it would be
great.

Also, you don't need to register anything to use class libraries. You just
need to: 1) Make the class library a part of your solution, and 2) Add a
reference between the caller and the called class library (i.e. add a
reference to a project). Even this is not the only way to do it. That's
why I recommend you read up on class libraries first, there are just too
many things to cover in the topic for a reasonable introduction.

Feel free to ask specific questions, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top