Global namespace already exists error from VS2008

Posted on 2009-02-23
Medium Priority
Last Modified: 2013-12-17
I am getting the following error during the build process in VS2008.
The namespace '<global namespace>' already contains a definition for 'XXXXX'; XXXX is the name of my application and not really XXXXX (just to clarify).

I have searched the solution for XXXXX and have included namespace XXXXXX but can't find any reference.  I am getting this after I had VS include a image file in the resources.resx file.  I started getting this error last week when I added a Settings file which it named the same as my resources so I switched the names around and got things working.  I then removed the image from the resource using the designer, but again same error.

I have searched the web and they all say to find the duplicate namespace but since I can't find one I really can't solve it following their advice.  

Where is is this referenced if any and/or what else can I look for?  I really don't want to rename the resource file since that will cause major headaches.

Question by:nesoftware
  • 2
LVL 12

Expert Comment

ID: 23717401
You may have a problem with a "using" statement .. that's somewhere to look.

Author Comment

ID: 23717660
Not really sure how that would affect this.   The following is psuedo code out of the .resx file.  The XYZApp has the error indicated on it, not the XYZApp.Properties.

namespace XYZApp.Properties {
    using System;
I search for namespace XYZApp and don't get another hit.  I also searched for using XYZApp and again get nothing.

I am not real sure what else I would search for since only adding an image to the solution and adding it to the resource file caused this error.

Accepted Solution

nesoftware earned 0 total points
ID: 23721450
My problem was that for 6 months I have had the startup dialog created without a namespace.  It has worked up until this last week where I encountered this problem twice.  The first time I simply renamed the new settings file by adding a 1 to the end of the name.  The 2nd time I was adding a resource in and that caused the issue.  

Simply adding a namespace to the old dialog solved this issue.  No clue on why it just started to happen now and not a long time ago.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question