By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,156 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,156 IT Pros & Developers. It's quick & easy.

2 questions I hope make sense

P: n/a
1.
I am creating a project that will have many c# files
(100+). I want to split this project up into modules but
I am not sure what the best way would be. I was thinking
of creating a blank project and creating other projects
inside this blank project where each one of these
projects would have one namespace. Is there a better way
of organizing a project? Can I have just one project
that contains many other namespaces?

2.
I have a C# file called A.cs which is in a namespace
called AA which is in a project called AAA.
I also have a C# file called B.cs which is in a namespace
called BB which is in a project called BBB.
In B.cs, I want to use the A.cs file. So at the
beginning of the B.cs file, I put:

using AA;

However, I get the following error message:
The type or namespace name 'AA' could not be found (are
you missing a using directive or an assembly reference?)

What can I do to solve this? Any ideas to these questions
will be greatly appreciated. Thanks for your reply.

Mike
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Mike
I will attempt to answer them for you :)
1. You can split the files into a number of projects and compile each
project into a .NET Module (not assembly!) then you can link the one or more
modules into an Assembly (you have to use the command line compiler to do
all this). That gives you some flexibility in how you use the IDE and
solutions. Try and keep the same namespace in one project ( more for ease
of use than any problems with the framework). As far as i know you can have
more than one namespace per project (even per file - but not per class)

2. Project BBB needs to add a reference to project AAA if they are in the
same solution or Project BBB needs to add a reference to assembly AA if not.
Both ways end up having a copy of assembly AA in the same directory as
assembly BB. Then your using statement will work :)

Hope it helps
Mark

"Mike" <mi*******@hotmail.com> wrote in message
news:08****************************@phx.gbl...
1.
I am creating a project that will have many c# files
(100+). I want to split this project up into modules but
I am not sure what the best way would be. I was thinking
of creating a blank project and creating other projects
inside this blank project where each one of these
projects would have one namespace. Is there a better way
of organizing a project? Can I have just one project
that contains many other namespaces?

2.
I have a C# file called A.cs which is in a namespace
called AA which is in a project called AAA.
I also have a C# file called B.cs which is in a namespace
called BB which is in a project called BBB.
In B.cs, I want to use the A.cs file. So at the
beginning of the B.cs file, I put:

using AA;

However, I get the following error message:
The type or namespace name 'AA' could not be found (are
you missing a using directive or an assembly reference?)

What can I do to solve this? Any ideas to these questions
will be greatly appreciated. Thanks for your reply.

Mike

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.