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 / Visual Studio.NET / IDE / May 2004

Tip: Looking for answers? Try searching our database.

Name conflict in solution

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Armin Zingler - 07 May 2004 13:11 GMT
Hi group,         (VB.Net 2003)

in one solution, there are two WindowsApplication projects. They don't have
a relation to each other (are no classlibraries). In the solution
properties, there are no dependencies either. When compiling one project I
get the following error:

g:\bla\calendar\Form1.vb(1): class "Form1" and class "Form1", defined in
"G:\bla\WindowsApplication3\Form1.vb", conflict in Namespace
"WindowsApplication3".

(roughly translated from German)

The solution is stored in g:\bla.
project 1 in g:\bla\calendar
project 2 in g:\bla\WindowsApplication3

Project 2 is the only startproject in the solution.

After searching for the reason of the error, I found out that project 1
("calendar") had the same root namespace as the second (both
"WindowsApplication3"). BTW, both are not "real" projects, only for testing.
Q: Why mustn't the projects have the same namespace? They don't have to do
anything with each other. What does the compiler want to "link" together? Is
there an explanation for this?

Signature

Armin

CT - 07 May 2004 13:40 GMT
They can have the same namespace, but youn can't define two or more classes
with the same name within a single namespace. How would the compiler know
which to choose?

Signature

Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105

> Hi group,         (VB.Net 2003)
>
[quoted text clipped - 24 lines]
> Is
> there an explanation for this?
Armin Zingler - 07 May 2004 15:36 GMT
> They can have the same namespace, but youn can't define two or more
> classes  with the same name within a single namespace. How would the
> compiler know  which to choose?

The other class is in a *different* project. The projects have no relation
to each other.

Signature

Armin

Armin Zingler - 12 May 2004 13:03 GMT
Anybody?

Steps to reproduce:

1. Create new Winforms project
2. Add new Winforms project to the same solution
3. Set root namespace of 2nd project equal the one of the 1st project

In VB.Net: error, Form1 defined twice (not only in the tasklist, also when
building one of the projects). That's not ok because they are completeley
independent projects!

Same steps done in C#: No error! That there is no error in C#, as expected,
shows that it must be a bug in the VB.Net integration.

Signature

Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Dan Moseley - 30 May 2004 10:57 GMT
Yep, you're right, looks like a bug. I guess most people don't set them to
the same value. I can see it in VS 2003 but not in my build of VS 2005 so
looks like they already fixed it there.

Dan [ms]

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

> Anybody?
>
[quoted text clipped - 10 lines]
> Same steps done in C#: No error! That there is no error in C#, as expected,
> shows that it must be a bug in the VB.Net integration.
Armin Zingler - 31 May 2004 13:56 GMT
> > Steps to reproduce:
> >
[quoted text clipped - 15 lines]
> them to the same value. I can see it in VS 2003 but not in my build
> of VS 2005 so looks like they already fixed it there.

Ok, thx. I've only set it to the same value by accident.

Signature

Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


Rate this thread:







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.