Global namespace already exists error from VS2008

Posted on 2009-02-23
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
    LVL 12

    Expert Comment

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

    Author Comment

    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Normally a window is moved by clicking on the caption bar and dragging. You may want your user to be able to move borderless forms or move a form by clicking anywhere in the form without the limitation to the caption bar. There are many ways to do i…
    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now