473,836 Members | 1,345 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 6502
answer me this question please:

In the App_Code directory, you can define custom namespaces for .cs files.
But if you add a Dataset (.xsd) how can you define his namespace in the web
project?
"Christophe r Reed" wrote:
In actuality, if you are developing everything within the same website, then
why do you need a namespace. If you use the App_Code directory for your
website-specific classes and you have multiple ASPX pages (with or without
code-behind), they are all compiled into the same assembly, so where's the
need for a namespace.

Note that I add my namespaces to my website files and I have no problem with
it. It's not a major issue.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

<m.******@dev.i t> wrote in message
news:ej******** *****@TK2MSFTNG P11.phx.gbl...
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 27 '06 #11
On Fri, 27 Jan 2006 00:43:02 -0800, abunet <ab****@ab.it > wrote:
You are confusing the problem.

Namespaces aren't assemblies.

I never said they were.
You can define the same namespace for different assemblies.
NAMESPACES are LOGICAL rappresentation of your class library.

And a Web site is an Application with one or more assemblies.

Why the assemblies of a web site cannot be rappresented in namespaces?

You aren't writing a class library, you are writing a web application.

The ASP.NET runtime will be the only client for all those Page and
UserControl derived types in your web application. The runtime doesn't
need namespaces to figure out what type to use. This is unlike a
developer. Namespaces present logical groupings for developers. I
don't see how there is a BIG black hole when we don't have to write
code like:

using My.WebForms;

Default_aspx form = new Default_aspx();

--
Scott
http://www.OdeToCode.com/blogs/scott/
"Scott Allen" wrote:
On Thu, 26 Jan 2006 17:26:54 +0100, m.******@dev.it wrote:
>
>Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
>black hole.
>


I don't think it's a big issue. 99% of the types in code-behind /
code-beside files are never used outside of the files they are defined
in. Many times they end up in isolated assemblies.

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


Jan 27 '06 #12
On Fri, 27 Jan 2006 00:38:02 -0800, abunet <ab****@ab.it > wrote:
I'm sorry but I don't agree with you.

All the .Net framework is a library subdivided in namespaces.

I'm sorry if you say that you don't need namespaces, you say that .Net
framework doesn't need them.


The framework does need namespaces. It would be a nightmare to find
classes in a flat hierarchy.

The difference is that the types in the framework have to be found by
human developers. The types in a web application are used only by the
runtime.

There are exceptions of course, like the PreviousPage property for a
cross page postback, but even then I think it's preferable to
represent the other entity using an interface or a base class defined
in a class library (or App_Code) that IS inside a logical namespace
(so it can be found).

Leave the Page and UserControl derived types as islands unto
themselves.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Jan 27 '06 #13
Could you give us the exact error? Perhaps some code? It sounds like
something else is wrong.

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

On Fri, 27 Jan 2006 00:51:02 -0800, abunet <ab****@ab.it > wrote:
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).

Now, if I have to define ONE namespace for ONE class, a good developer
SHOULD define namespaces for ALL the classes in the projects.

I'll post the question in another thread.

"m.******@dev. it" wrote:
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 27 '06 #14
Maybe I'm not explaining very well.

- First of all, if you make a little search on the newsgroup or the web
(keywords: dataset namespace) , you'll find a lot of post with the same
problem.

- Second, You are forgotting that in VS2003, the IDE works in this manner:
if you add a folder to a Web Project, and then an aspx file into it, if you
take a look at the code behind, you will see that the class will have a
namespace with this construct:

namespace myprojectnamesp ace.myfolder

- To reproduce the problem in VS2005, just add 2 folders to a web site, and
then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
get an error.

- Third do the same with 2 xsd files. In a web site add two folders in the
App_Code. Call each xsd file DataSet1.xsd and put each xsd in a folder.

When you say that you don't need namespaces, I get suprised.
You should only answer this questions:

1) How can you define the namespace of a xsd file in a Web site?
2) Custom Namespaces are built automatically in ClassLibrary and
WindowsForms projects. Why not in Web sites?
3) Why in VS2003 the project namespaces were created automatically and now
not? (compatibility)

Thanks

"Scott Allen" wrote:
Could you give us the exact error? Perhaps some code? It sounds like
something else is wrong.

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

On Fri, 27 Jan 2006 00:51:02 -0800, abunet <ab****@ab.it > wrote:
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).

Now, if I have to define ONE namespace for ONE class, a good developer
SHOULD define namespaces for ALL the classes in the projects.

I'll post the question in another thread.

"m.******@dev. it" wrote:
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 28 '06 #15
"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 28 '06 #16
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 28 '06 #17
On Sat, 28 Jan 2006 00:59:26 -0800, abunet <ab****@ab.it > wrote:

- To reproduce the problem in VS2005, just add 2 folders to a web site, and
then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
get an error.


Can you tell us what the specific error message is?

You can't possibly have type name collisions unless there is something
you aren't telling us. The default ASP.NET batch compilation will
generate an assembly for each directory. The assemblies will both have
names like App_Web_*.dll. Even then, the CodeFile classes should have
names like Folder1_Default and Folder2_Default .

Are you using aspnet_merge.ex e, perhaps?

--
Scott
http://www.OdeToCode.com/blogs/scott/
Jan 28 '06 #18
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?

"Scott Allen" wrote:
On Sat, 28 Jan 2006 00:59:26 -0800, abunet <ab****@ab.it > wrote:

- To reproduce the problem in VS2005, just add 2 folders to a web site, and
then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
get an error.


Can you tell us what the specific error message is?

You can't possibly have type name collisions unless there is something
you aren't telling us. The default ASP.NET batch compilation will
generate an assembly for each directory. The assemblies will both have
names like App_Web_*.dll. Even then, the CodeFile classes should have
names like Folder1_Default and Folder2_Default .

Are you using aspnet_merge.ex e, perhaps?

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

Jan 29 '06 #19
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 #20

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

Similar topics

3
2322
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
16293
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
1559
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
2900
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
9813
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10249
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
9367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6976
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
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
5818
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4447
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
2
4007
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3108
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.