473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

namespaces and directory structure

when creating a project with namespace like:
wrox.csharp.basics.overflowtest
is it good practice to have the directory structure like that also:
c:\wrox\csharp\basics\overflowtext.cs

Also if it is then is there a way to make visual studio set it up for
me as i'm creating the cs files? or do i have to first create the
directory structures and then as i save files save them in the correct
places depending on the namespace i create.
Nov 16 '05 #1
1 1380
soni29,

Generally, I like to do that as well. However, I found it difficult to
perform generic operations on the projects in VS.NET, so I flattened my
directory structure out so that the directory name is the full namespace.
So, in my main directory, I have:

Casper
Casper.Net
Casper.Windows.Forms
etc.
etc.

You ^might^ be able to have VS.NET do this for you by modifying the
common.js file that is in the C# program directory under the VS.NET
directory. There are a number of templates that are used for new items.
You could modify the template/script for a new class to create the directory
based on the namespace.

However, this will most likely not work, because the namespace defaults
when the file is created, and determining when the namespace changes in the
editor and then moving the file will require a lot of work (you would have
to create the directory structure, move the file, and update the project
file).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"soni29" <so****@hotmail.com> wrote in message
news:ca**************************@posting.google.c om...
when creating a project with namespace like:
wrox.csharp.basics.overflowtest
is it good practice to have the directory structure like that also:
c:\wrox\csharp\basics\overflowtext.cs

Also if it is then is there a way to make visual studio set it up for
me as i'm creating the cs files? or do i have to first create the
directory structures and then as i save files save them in the correct
places depending on the namespace i create.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: db | last post by:
Hey group I'm rewriting a small program called lockdown and need a little help structuring the code. In the past I didn't use nested namespaces and I placed all my files in one directory. This...
4
by: Jan Michalski | last post by:
Does anyone know how to incorporate classes with different namespaces within a project? I have two classes with the same name but different namespace. When I try to add the the second class of the...
3
by: Jim Heavey | last post by:
Trying to get the hang of Namespaces. I have primarly developed in VB and am transitioning to C# and the .Net Environment. I have worked a bit with Java as well in school about a year or so ago....
6
by: Michael C | last post by:
In Vb a class was a file, but in C# you have multiple classes in one file which has a namespace. I am trying to get some common code libraries written but this is stuffing my head up. Is it...
3
by: Charlie Calvert | last post by:
I'm new to C# and am used to Java, where there is a correspondence between package names and directories. I'm having trouble creating the same functionality in Visual Studio. In particular, I'm...
1
by: soni29 | last post by:
when creating a project with namespace like: wrox.csharp.basics.overflowtest is it good practice to have the directory structure like that also: c:\wrox\csharp\basics\overflowtext.cs Also if it...
9
by: Patty O'Dors | last post by:
Hi Can somebody please tell me what namespaces are actually for? I notice that when I start a new project in C#, it puts everything in a namespace of the same name as the project. I found them...
17
by: clintonG | last post by:
Using 2.0 with Master Pages and a GlobalBaseClass for the content pages. I understand the easy part -- the hierarchical structure of a namespace naming convention -- but the 2.0 IDE does not...
7
by: Rich Milburn [MVP] | last post by:
Ok I am not a programmer, I copied some code and very painfully got it working in VB6. I can adjust the volume with waveOutSetVolume on winmm.dll. But I could not seem to be able to figure out how...
2
by: Thom Little | last post by:
In 1.1 I could have two namespaces in the same webgspace. The webspace is on a remote server. I compile the namespaces separately and check them out on localhost and when they are checked-out I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.