Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:56+00:00 2026-06-05T12:09:56+00:00

Our team has recently migrated from Visual Studio 2008/.NET3.5 to Visual Studio 2010/.NET4.0. Now,

  • 0

Our team has recently migrated from Visual Studio 2008/.NET3.5 to Visual Studio 2010/.NET4.0. Now, VS2010 gives me a strange error message. It’s reproducible with the following program:

using System;

namespace Some.Main
{
}

namespace SomeLib
{
    interface Some
    {
    }
}

namespace ConsoleApplication1
{
    using Some.Main;
    using SomeLib;

    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Press enter to continue");
            Console.ReadLine();
        }
    }
}

This worked just fine in VS2008, but in VS2010 I get the following error message:

The type name ‘Main’ does not exist in the type ‘SomeLib.Some’

Interestingly, if I hit ‘Build Solution’, the program builds just fine, and I can even execute it without any problems. It’s just Visual Studio that seems to have a problem with this code.

Unfortunately, I’m working on a large-ish legacy application and I cannot (easily) change the names of these namespaces.

I’d like to know how I can fix this error, and I’m also curious what causes it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:09:56+00:00Added an answer on June 5, 2026 at 12:09 pm

    You simply make the editor confused. Some is both a namespace and an interface name, evidently it doesn’t check/parse usings in the order they’re declared.

    If you want to make clear you’re referring to the namespace and not the type name simply add global:: to the using declaration (to start from the root namespace), like this:

    using global::Some.Main;
    

    UPDATE
    Very good post here on SO linked by @alex in a comment: Should 'using' statements be inside or outside the namespace?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our team has recently migrated to git. We have production web application server with
Our team has recently been working on a logic and data layer for our
Our team has recently been considering pushing out a minor registry fix to users
Our team is now beginning to look at jumping from 2.0 to 3.5 and
We recently ran in to a problem.Our team has automated test scripts with selenium.
Our team has just moved from Netbeans to IntelliJ 9 Ultimate and need to
Our team has recently inherited code which is extremely disorganized. As a result, my
my team has made the decision recently to use Moq as our mocking framework
My manager has recently asked my team and I for our input about implementing
Recently I've changed our team build project file from: <SolutionToBuild Include=$(SolutionRoot)/OurSolution.sln> to <SolutionToBuild Include=$(SolutionRoot)/**/*.csproj>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.