Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2006

Tip: Looking for answers? Try searching our database.

partial namespace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steph - 31 Mar 2006 09:04 GMT
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.
jan.hancic@gmail.com - 31 Mar 2006 09:17 GMT
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.
Joanna Carter [TeamB] - 31 Mar 2006 09:20 GMT
| 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

Signature

Joanna Carter [TeamB]
Consultant Software Engineer

Steph - 31 Mar 2006 10:04 GMT
> | can we do a partial namespace ?
>
[quoted text clipped - 30 lines]
>  ...
> }

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
Steph - 31 Mar 2006 10:53 GMT
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 ?

> | can we do a partial namespace ?
>
[quoted text clipped - 32 lines]
>
> Joanna

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.