473,902 Members | 5,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disadvantages in Visual Studio 2005 (Web sites)

In the book:
"Working with Microsoft Visual Studio 2005"
Craig Skibo wrote:
"The power of Visual Studio 2005 lies in its ability to empower users to
build, test, and debug powerful applications quickly and easly."

I don't agree on what concernes ASP .NET Web Sites in VS2005.

All what involves Namespaces in Web sites has been disappeared. I know
you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
project I can subdivide the App_Code Folder in subfolders, but if I use
the Powerfull "Class View" Window, I'm not very glad to see an infinity
number of classes, all placed at the root of the project namespace.

Grouping in namespaces is one of the most powerful skills tha .net gave
us, since 1.0 and not only for .Net Windows Projects.

Someone could reply me that the problem is pre-compilation. I know that
now you can choose how to build your Web site, and this is very good.
But the need of defining namespaces and grouping classes is indipendent
from the way I'll decide to deploy the Web Site.

Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
black hole.

I'm sorry for this lines, but I'm tired to search for workarounds for an
IDE, abive all when a functionality was already present in the previous
version.

Marco Roello
ma**********@cn rservice.it
Jan 26 '06
54 6519
Thanks for your test, but it still doesn't work.

"Scott Allen" wrote:
1. Using a file naming convention.
These are my steps:
remeber that I'm using a C# Web Site
In VS, right click App_Code and then "Add New Item"
selected Dataset in the templates window, and wrote "Foo.DataSet1.x sd"
instead od "DataSet1.x sd"

The result is a class with Namespace called Foo, but the class name is
called Foo too!!

This is the vs generated code of the DataSet:
namespace Foo {
using System;

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Data. Design.TypedDat aSetGenerator", "2.0.0.0")]
[Serializable()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Componen tModel.ToolboxI tem(true)]

[System.Xml.Seri alization.XmlSc hemaProviderAtt ribute("GetType dDataSetSchema" )]
[System.Xml.Seri alization.XmlRo otAttribute("Fo o")]
[System.Componen tModel.Design.H elpKeywordAttri bute("vs.data.D ataSet")]
public partial class Foo : System.Data.Dat aSet {
..
..
..

"Scott Allen" wrote: 2. Use a class library instead of App_Code.
2. This confirms that Vs2005 Web sites don't support namespaces

"Scott Allen" wrote:
On Sun, 29 Jan 2006 01:38:27 -0800, abunet <ab****@ab.it > wrote:
That demonstrates that you ask me questions without trying.

Just do what I described in VS2005, (1.5 minutes of work) and you'll get the
error.
I've also opened a Bug Reuest at Microsoft, and they have reproduced the
problem.

Have you got VS2005?


Yes, VS 2005 RTM.

I have no problems putting two default.aspx web forms into two
different directories. Please elaborate on the problem you see in this
scenario.

I do have a problem putting two .xsd files with the same name into two
sub-directories of App_Code. You can put the generated DataSets into
different namespaces by:

1. Using a file naming convention.

2. Use a class library instead of App_Code.

As an example of #1, name one file Foo.DataSet1.xs d and the other
Bar.DataSet1.xs d. The runtime will generate a DataSet1 class in a Foo
namespace, and a DataSet1 class in a Bar namespace.

--
Scott
http://www.OdeToCode.com/blogs/scott/

Jan 30 '06 #21
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the
class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult
"abunet" <ab****@ab.it > wrote in message
news:84******** *************** ***********@mic rosoft.com...
Mark,
we are talking about Visual Studio 2005. The RAD Tool.
I know that you can manually define different namespaces.

Please read again all the posts.

"Mark Rae" wrote:
"abunet" <ab****@ab.it > wrote in message
news:97******** *************** ***********@mic rosoft.com...
A question to everyone tells me that they don't need namespaces:

In your web site. You have 2 folders with 2 default.aspx files, one in
each
folder.

If build the web site, you'll get an error, because the compiler finds two classes with the same name.

The solution is to define a different namespace for each aspx file (or one of them).


That simply isn't true.

<webroot>
/home
default.aspx
<%@ Page language="c#" CodeFile="defau lt.aspx.cs"
Inherits="home_ default" %>
default.aspx.cs
public partial class home_default
/welcome
default.aspx
<%@ Page language="c#" CodeFile="defau lt.aspx.cs"
Inherits="welco me_default" %>
default.aspx.cs
public partial class welcome_default
> Now, if I have to define ONE namespace for ONE class, a good developer SHOULD define namespaces for ALL the classes in the projects.


Why? Says who?

Jan 30 '06 #22
On Mon, 30 Jan 2006 02:59:12 -0800, abunet <ab****@ab.it > wrote:
Thanks for your test, but it still doesn't work.


Ah, I think I found the culprit.

1) Go to App_Code and add a new Item named "Foo.DataSet1.x sd".

2) Observe the generated DataSet is Foo in namespace Foo (Foo.Foo).
There appears to be a bug in the VS2005 xsd template.

The reason it worked for me is because I did:

1) Go to App_Code and add a new Item named "DataSet1.x sd".

2) Right click "DataSet1.x sd" and rename to "Foo.DataSet1.x sd".

3) Observe the type now has the desired name and is in the Foo
namespace (Foo.DataSet1).

What's the difference? Three attributes in the opening xs:element tag
of the .xsd. The item template is not putting the correct name in
these attributes. Fortunately, it's easy to correct. Either do the
"Add" and "Rename" workaround, or:

1) Go to App_Code and add a new Item named "Foo.DataSet1.x sd".

2) Right-click "Foo.DataSet1.x sd" and select "View Code".

3) Go to the opening <xs:element> tag and replace instances of "Foo"
with "DataSet1" in 3 attributes.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Jan 30 '06 #23
Scott Allen wrote:
Ah, I think I found the culprit. There appears to be a bug in the VS2005 xsd template.


This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)
Jan 31 '06 #24
Gerry,
That's simply not true.
They are not working as I expect.
But we have found a workaround.
And about the first post you made:
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the
class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult
the generated code is NOT inside a new namespace, but is the CLASS NAME that
is built with the syntax: myfolder_myclas s.

It seems that there are differences between vb projects and c# projects
templates.

Everyone in this thread are forgotting one of the most important question of
this thread.
In VS2003 (since VS2002), the default behavior was creating NAMESPACES for
each subfolder of the project.

Now everything has been lost. All you posts are confirming that the behavior
of VS2005 has totally changed.

And you must assume that in Class Library projects, Control Library
projects, Windows Form projects, the behavior of building namespaces in
completly different. That's the fact. So my question is simply: WHY?

Compatibility is one of the most important thing that we need to improve
development continuity, but it seems that I'm the only developer of Web
Projects in C# since VS2002, or this requirement it's not furhter important.

"Gerry Hickman" wrote:
Scott Allen wrote:
Ah, I think I found the culprit.

There appears to be a bug in the VS2005 xsd template.


This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)

Jan 31 '06 #25
Thanks Scott.

You've found one.
And what about the code behind generated for WebForms in subfolders? There
Namespaces are not added to.

So when I say that VS2005 has lost namespaces management am I in true?

"Scott Allen" wrote:
On Mon, 30 Jan 2006 02:59:12 -0800, abunet <ab****@ab.it > wrote:
Thanks for your test, but it still doesn't work.


Ah, I think I found the culprit.

1) Go to App_Code and add a new Item named "Foo.DataSet1.x sd".

2) Observe the generated DataSet is Foo in namespace Foo (Foo.Foo).
There appears to be a bug in the VS2005 xsd template.

The reason it worked for me is because I did:

1) Go to App_Code and add a new Item named "DataSet1.x sd".

2) Right click "DataSet1.x sd" and rename to "Foo.DataSet1.x sd".

3) Observe the type now has the desired name and is in the Foo
namespace (Foo.DataSet1).

What's the difference? Three attributes in the opening xs:element tag
of the .xsd. The item template is not putting the correct name in
these attributes. Fortunately, it's easy to correct. Either do the
"Add" and "Rename" workaround, or:

1) Go to App_Code and add a new Item named "Foo.DataSet1.x sd".

2) Right-click "Foo.DataSet1.x sd" and select "View Code".

3) Go to the opening <xs:element> tag and replace instances of "Foo"
with "DataSet1" in 3 attributes.

--
Scott
http://www.OdeToCode.com/blogs/scott/

Jan 31 '06 #26
I agree that you are seeing a change in the way that a web project works.
I'm not really sure what the driving purpose behind the change was ( not
that I have looked into it ) , but I disagree with your assertion that the
change is a problem.
You have it fixed in your mind how things should work, and rather than just
accept that the change, you are fighting it and creating a problem where one
really does not exist.
If you have a true need for namespaces because you have a class that will
also be used outside of your web project, then it should be created and
maintained in a separate class library project and referenced by your web
project, then you would have the same namespace behaviour as you did in
2003. And if you have some legit reason for namespaces within the web
project you are free to create them yourself as you please. Sure it means
some extra manual effort, but that is the price you pay for insisting on
having something that isn't required.

since the bug in the dataset template has been exposed , do you have any
other issue that actually relates to a web project being namespace-less ?
"abunet" <ab****@ab.it > wrote in message
news:99******** *************** ***********@mic rosoft.com...
Gerry,
That's simply not true.
They are not working as I expect.
No not as you expected, but that doesn't make it wrong.
But we have found a workaround.
And about the first post you made:
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult
the generated code is NOT inside a new namespace, but is the CLASS NAME

that is built with the syntax: myfolder_myclas s.
and that is exactly what i said "class = " , I made no mention at all of
namespaces
I was simply addressing the statement that 2 default.aspx's can't have a
class name collision unless you go out of your way to create one.

It seems that there are differences between vb projects and c# projects
templates.

Everyone in this thread are forgotting one of the most important question of this thread.
In VS2003 (since VS2002), the default behavior was creating NAMESPACES for each subfolder of the project.

Now everything has been lost. All you posts are confirming that the behavior of VS2005 has totally changed.
I am failing to see what 'has been lost' ?

And you must assume that in Class Library projects, Control Library
projects, Windows Form projects, the behavior of building namespaces in
completly different. That's the fact. So my question is simply: WHY?

completely different compared to what ?
as far as i can tell these still works exactly the same as they did in 2003
Compatibility is one of the most important thing that we need to improve
development continuity, but it seems that I'm the only developer of Web
Projects in C# since VS2002, or this requirement it's not furhter important.

correct - multiple namespaces within a single web project are no longer
necessary / important

"Gerry Hickman" wrote:
Scott Allen wrote:
Ah, I think I found the culprit.

There appears to be a bug in the VS2005 xsd template.


This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)

Jan 31 '06 #27
This is not about how YOU expect it to work; it's about how the designers
expect it to work. You need to change your mindset and be open to these
changes.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"abunet" <ab****@ab.it > wrote in message
news:99******** *************** ***********@mic rosoft.com...
Gerry,
That's simply not true.
They are not working as I expect.
But we have found a workaround.
And about the first post you made:
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the
class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult


the generated code is NOT inside a new namespace, but is the CLASS NAME
that
is built with the syntax: myfolder_myclas s.

It seems that there are differences between vb projects and c# projects
templates.

Everyone in this thread are forgotting one of the most important question
of
this thread.
In VS2003 (since VS2002), the default behavior was creating NAMESPACES
for
each subfolder of the project.

Now everything has been lost. All you posts are confirming that the
behavior
of VS2005 has totally changed.

And you must assume that in Class Library projects, Control Library
projects, Windows Form projects, the behavior of building namespaces in
completly different. That's the fact. So my question is simply: WHY?

Compatibility is one of the most important thing that we need to improve
development continuity, but it seems that I'm the only developer of Web
Projects in C# since VS2002, or this requirement it's not furhter
important.

"Gerry Hickman" wrote:
Scott Allen wrote:
> Ah, I think I found the culprit.

> There appears to be a bug in the VS2005 xsd template.


This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)

Jan 31 '06 #28
Gerry,
You are saying that I'm creating a problem that don't exists.
I say that the problem exists, because before changing the behavior of a
project template-driven code generator, a developer Team should consider the
impact with the past.

You must admint that a Default Behavior has changed, and it has changed ONLY
for Web Projects. WITHOUT motivations.

If you don't need namespaces in Web sites, you don't need them either in
Windows Forms, Control... etc. Why there they works as I expect?
So can I open a bug request in Microsoft telling them that Windows Forms
projects namespace management have to be removed?

Or do you think that Microsoft can do what he thinks its better without
considering the approach model proposed in the past (and in the present)?

When you were talking about namespaces in subfolders you were in WRONG. Do
you agree?
Why the need of changing how the Name of classes are built in the Code-Behind?

"gerry" wrote:
I agree that you are seeing a change in the way that a web project works.
I'm not really sure what the driving purpose behind the change was ( not
that I have looked into it ) , but I disagree with your assertion that the
change is a problem.
You have it fixed in your mind how things should work, and rather than just
accept that the change, you are fighting it and creating a problem where one
really does not exist.
If you have a true need for namespaces because you have a class that will
also be used outside of your web project, then it should be created and
maintained in a separate class library project and referenced by your web
project, then you would have the same namespace behaviour as you did in
2003. And if you have some legit reason for namespaces within the web
project you are free to create them yourself as you please. Sure it means
some extra manual effort, but that is the price you pay for insisting on
having something that isn't required.

since the bug in the dataset template has been exposed , do you have any
other issue that actually relates to a web project being namespace-less ?
"abunet" <ab****@ab.it > wrote in message
news:99******** *************** ***********@mic rosoft.com...
Gerry,
That's simply not true.
They are not working as I expect.


No not as you expected, but that doesn't make it wrong.
But we have found a workaround.
And about the first post you made:
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult


the generated code is NOT inside a new namespace, but is the CLASS NAME

that
is built with the syntax: myfolder_myclas s.


and that is exactly what i said "class = " , I made no mention at all of
namespaces
I was simply addressing the statement that 2 default.aspx's can't have a
class name collision unless you go out of your way to create one.

It seems that there are differences between vb projects and c# projects
templates.

Everyone in this thread are forgotting one of the most important question

of
this thread.
In VS2003 (since VS2002), the default behavior was creating NAMESPACES

for
each subfolder of the project.

Now everything has been lost. All you posts are confirming that the

behavior
of VS2005 has totally changed.


I am failing to see what 'has been lost' ?

And you must assume that in Class Library projects, Control Library
projects, Windows Form projects, the behavior of building namespaces in
completly different. That's the fact. So my question is simply: WHY?


completely different compared to what ?
as far as i can tell these still works exactly the same as they did in 2003
Compatibility is one of the most important thing that we need to improve
development continuity, but it seems that I'm the only developer of Web
Projects in C# since VS2002, or this requirement it's not furhter

important.

correct - multiple namespaces within a single web project are no longer
necessary / important

"Gerry Hickman" wrote:
Scott Allen wrote:

> Ah, I think I found the culprit.

> There appears to be a bug in the VS2005 xsd template.

This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)


Jan 31 '06 #29
You're right. I was meaning that It doesn't work LIKE ALL the other VS
project types.
You need to change your mindset and accept that the difference exists and
WITHOUT MOTIVATION.

Someone maybe is thinking that I'm one of the anti-microsoft products posters.
I'm speaking as a 12 Years developer in Microsoft Products. I've found a lot
of bugs in this years, and accepted them like all developers.

But I still continue to say this TYPE of changes are inaccetable.

When you say that the change EXISTS and is not a problem, you are admitting
that there was NO REASON to make the change.

And the TEST is that this Behavior persists in the other type of VS projects.

"Christophe r Reed" wrote:
This is not about how YOU expect it to work; it's about how the designers
expect it to work. You need to change your mindset and be open to these
changes.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"abunet" <ab****@ab.it > wrote in message
news:99******** *************** ***********@mic rosoft.com...
Gerry,
That's simply not true.
They are not working as I expect.
But we have found a workaround.
And about the first post you made:
please open up vs 2005 and try this for yourself
mark is absolutely correct, web forms have the subfolder prepended to the
class name in vs2005.
/default.aspx - class = _default
/subfolder/defualt.aspx - class = subfolder_defau lt
/subfolder2/defualt.aspx - class = subfolder2_defa ult


the generated code is NOT inside a new namespace, but is the CLASS NAME
that
is built with the syntax: myfolder_myclas s.

It seems that there are differences between vb projects and c# projects
templates.

Everyone in this thread are forgotting one of the most important question
of
this thread.
In VS2003 (since VS2002), the default behavior was creating NAMESPACES
for
each subfolder of the project.

Now everything has been lost. All you posts are confirming that the
behavior
of VS2005 has totally changed.

And you must assume that in Class Library projects, Control Library
projects, Windows Form projects, the behavior of building namespaces in
completly different. That's the fact. So my question is simply: WHY?

Compatibility is one of the most important thing that we need to improve
development continuity, but it seems that I'm the only developer of Web
Projects in C# since VS2002, or this requirement it's not furhter
important.

"Gerry Hickman" wrote:
Scott Allen wrote:

> Ah, I think I found the culprit.

> There appears to be a bug in the VS2005 xsd template.

This is what I was wondering; is it correct to say that "namespaces " in
general are working in VS2005, but there's a problem with DataSets that
use xsd?

--
Gerry Hickman (London UK)


Jan 31 '06 #30

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

Similar topics

3
2323
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in Asp.Net 1.1 / VB.NET. These web sites use Access Databases and NOT Microsoft SQL 2000. In the future I will need to make a few changes now and then to this web sites.
8
16296
by: William LaMartin | last post by:
I just received my Visual Studio upgrade to 2005 and tried to create a new web site via File | New Web Site with location http. Unfortunately I received the following error: "Visual Web Developer does not support creating Web sites on a SharePoint Web server" If I create a new server extensions 2002 web in IIS and mark it as an application and try to use it from Visual Studio I receive the same error.
8
1565
by: jdn | last post by:
I have a root application that has various sub-applications (subdirectories set up as applications within IIS). All of the sub-applications rely on the root application for profiles, membership, etc. This all worked fine for a bit, but now, I get an error when trying to build the root site: "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a...
1
2903
by: cnixuser | last post by:
Hello, I am having a problem that I believe is related to the way a stream reader object looks for a text file by default. What I am doing is using a StreamReader object to read the text of a text file which includes some html code to populate html formatted content as the text of an asp:label (<asp:label>). The reading of the text file itself goes just fine ;however, this only occurs when I use an absolute file path which will not work of...
0
9845
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11279
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10499
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4725
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3323
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.