0

I've googled for creation of namespaces and found some very useful examples, what these examples didn't have is how do I compile and implement my created namespace on my system so I can include it from my various applications.

So for example, if I create a namespace to load a config file from my application path and insert it to an array, Do i need to include the namespace on any project I use or is there a way to make it part of my environment?

2
  • 4
    You should accept answers to your questions. Commented May 25, 2010 at 0:59
  • I agree with SLaks. Nine questions and no accepted answers is whack. Commented May 25, 2010 at 1:59

4 Answers 4

1

You're thinking of Class Library (DLL) projects.

Sign up to request clarification or add additional context in comments.

Comments

0

When you start up a new Visual Studio project, select Class Library rather than Windows Form project. This will compile your namespaces as a DLL (exposing your public classes), which can be referenced in other projects.

Comments

0

If you want to include a namespace that you created you have to add a reference to your project first. If you have compiled your code into a .dll file, then simply add the reference to the .dll file to your project and then at the top of your classes put the "Imports [Namespace]". If you haven't compiled your namespace, add the project (with the namespace that you created) to your solution, add the reference to it (under the Projects tab), and then use the Imports statement.

Comments

0

You are confusing the concept of a namespace with the concept of a project, especially of a class library project.

A class exists within a namespace. If no namespace is defined, then the class still exists within the global namespace (the one with no name).

In any case, it's classes that do the work. Namespaces are only so that you can have a class named Book, and I can have a class named Book, and so that TriDat.Book can exist at the same time as JohnSaunders.Book.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.