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

partial namespace

P: n/a
hello,
can we do a partial namespace ?
i want split my cs file (contain all my classes) in a lot of files and then
compil their into my DLL...
so in this case, is more easy to work :

library.dll =
library.net.cs
library.fileio.cs
library.xml.cs
library.img_manipulation.cs
etc ...
thx

S.
Mar 31 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
There is no requierment that all types that belong to a namespace must
be in the same file.

And I think you are missing something there. If you wan't to compile
everything into one DLL then make a Class library proejct put your
files there compile and you will get your DLL.

Mar 31 '06 #2

P: n/a
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Mar 31 '06 #3

P: n/a

"Joanna Carter [TeamB]" <jo****@not.for.spam> a écrit dans le message de
news: %2****************@TK2MSFTNGP11.phx.gbl...
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}
hum... yes... i m missing something...
so i can do :
csc /target:library /out:mylibrary.dll xml.cs fileio.cs net.cs etc...
?
i m really miss something ;-)

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Mar 31 '06 #4

P: n/a
no work...
i create two .cs file :
"net.cs" with :
namespace myTest
{
public class netTest {
//...
}
}

and a "xml.cs" with :
namespace myTest
{
public class xmlTest {
//...
}
}
then i compil :

csc /target:library /out:mylibrary.dll xml.cs net.cs

but... in my "mylibrary.dll" i v not my "xmlTest" class (or "netTest")...

how do ?
"Joanna Carter [TeamB]" <jo****@not.for.spam> a écrit dans le message de
news: %2****************@TK2MSFTNGP11.phx.gbl...
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Mar 31 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.