namespace question - basics

  • Thread starter Thread starter jp2msft
  • Start date Start date
J

jp2msft

How do I include namespaces in my projects?

It is getting to where several of my projects use a lot of the same code, so
I have placed this code in a separate class. It does not need to be edited
often, and it can remain closed for the most part.

However, I would like to have a single file for this class, but I don't know
how to do this right now. I've seen it before, but I don't remember what it
was called, so I don't know what to search.

If my class is declared as namespace "Company_Class" and my projects are
namespaced "Company_ProjectA" and "Company_ProjectB", how do one of my
"Company_ProjectX" namespaces use the "Company_Class" namespace? It seems
like it is included at the top like "using Company_Class;" or something like
that.

Could someone show me this?
 
Right-click your solution then select the menu

Add->New Project->Class Library

namespace MyCompany.SomethingElse
{
public class MyClass { }
}


In the other project right-click References and select "Add reference", then
click the [Projects] tab and select that new class library.



--
Pete
=========================================
I use Enterprise Core Objects (Domain driven design)
http://www.capableobjects.com/
=========================================
 
Back
Top