Namespaces and Folders

M

Mythran

I have a namespace standard that I have to adhere to set by our development
staff:

[CompanyName.SolutionType.SolutionName.ProjectName]

So, an example:

MyCompany.Libraries.MyLibrary (When projectname == solutionname, we leave
the projectname off of the namespace).

Application:

MyCompany.Applications.MyApp.WebUI -> Web UI
MyCompany.Applications.MyApp.DAL -> Data Access Layer
MyCompany.Applications.MyApp.Schema -> Schema
et cetera ...

Now, for folders, we have standards similar to:

Solution
Project
classes
modules
data


Now, in the schema project, we have datasets under the data folder. In
VB.Net, this was good, we would dimension a variable in our other projects
(UI, WebUI, DAL, BLL, et cetera) similar to:

Dim ds As Schema.MyDataSet = New Schema.MyDataSet()

But in C#, because of the way it places the datasets under the namespace of
the parent folder, the way to create the same variable would be:

Dim ds As Schema.data.MyDataSet = New Schema.data.MyDataSet()

The above goes against the standards...not that it's all that bad, but we
don't want it like this. Is there a way, without manually editing the
autogenerated dataset code files, to keep the project namespace without
adding the foldername to the namespace inside classes added to the project,
or autogenerated code (such as the dataset)?

Thanks in advance...

Mythran
 
N

Nick Malik [Microsoft]

In Visual Studio projects, you can set the default namespace. That may work
for you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
M

Mythran

Nick Malik said:
In Visual Studio projects, you can set the default namespace. That may
work for you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--

I know this. That is how I get the
MyCompany.Applications.MySolution.MyProject part of the namespace...but the
..Net ide always adds the folder to the namespace when I don't want this at
all. Why does it force you to use the folder name as part of the namespace
(as in they autogenerate it for you and it is automatically part of the
namespace for autogenerated typed datasets which can be changed but makes
maintenance more difficult).

Why would there not be an option to turn that "feature" off? I have nothing
against Microsoft, but dang, couldn't they have thought far enough ahead on
this? (Yeah, I am one of the few that like ms products...even though I do
come from the *nix environment).

Any way around this?

Thanks,

Mythran
 
S

Sylvain Lafontaine

You can set the namespace specifically for a dataset by using the property
« Custom Tool Namespace » of the XSD file.

S. L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top