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 7867175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:38:26+00:00 2026-06-03T00:38:26+00:00

With Visual Studio 2010 (possibly 2008 as well) I am noticing behavior where Intellisense

  • 0

With Visual Studio 2010 (possibly 2008 as well) I am noticing behavior where Intellisense will suggest the fully qualified namespace for enums.

For example, I can write code like this:

element.HorizontalAlignment = HorizontalAlignment.Right;
element.VerticalAlignment = VerticalAlignment.Bottom;

But when I try to write it, it suggests I write it like this:

element.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
element.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;

This unnecessary extra code can really add up and makes it less readable, and I have to basically fight with Intellisense to avoid it.

Is there I reason for this? Can I just turn it off? I assume the reason is that the name of the enum is the same as the name of the property. But that’s really not a good reason.

EDIT:

Here’s another example that demonstrates why fully qualified naming is not necessary.

using SomeOtherNamespace;

namespace SomeNamespace
{
    public class Class1
    {
        public Class2 Class2 { get; set; }

        public Class1()
        {
            // These all compile fine and none require fully qualified naming.  The usage is context specific.
            // Intellisense lists static and instance members and you choose what you wanted from the list.

            Class2 = Class2.Default;
            Class2.Name = "Name";
            Class2.Name = Class2.Default.Name;
            Class2 = Class2;
        }
    }
}

namespace SomeOtherNamespace
{
    public class Class2
    {
        public static Class2 Default { get; set; }

        // public static Class2 Class2;  (This throws an error as it would create ambiguity and require fully qualified names.)

        // public static string Name { get; set; }  (This also throws an error because it would create ambiguity and require fully qualified names.

        public string Name { get; set; }
    }
}
  • 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-03T00:38:31+00:00Added an answer on June 3, 2026 at 12:38 am

    This indeed seems to be the same name for property & the type.
    Here is the smallest reproducible example that mimics things (could be smaller but this reveals more)…

    namespace Company.Project.SubProject.Area.Test.AndSomeMore
    {
        public class TestClass
        {
            public TestEnum MyEnum { get; set; }
            public TestEnum TestEnum { get; set; }
            public SndTestEnum NewEnum { get; set; }
        }
        public enum TestEnum
        {
            None,
            One,
            Two
        }
        public enum SndTestEnum
        {
            None,
            One,
            Two
        }
    }
    namespace MyCallerNS
    {
        public class MyTestClass : TestClass
        {
            public MyTestClass()
            {
                this.TestEnum = Company.Project.SubProject.Area.Test.AndSomeMore.TestEnum.One;
                this.MyEnum = Company.Project.SubProject.Area.Test.AndSomeMore.TestEnum.Two;
                this.NewEnum = SndTestEnum.None;
            }
        }
    }
    

    Both MyEnum and TestEnum properties (targetting TestEnum enum) offer ‘fully qualified’ names (other has different name than its property type but the type matches other property’s name, so both are ‘tainted’) – while SndTestEnum has different naming (for type, property) and works fine in either case.

    …funny thing is that even if you remove namespace MyCallerNS and put all under the ‘long namespace’ – it’d still add AndSomeMore. in front.

    There is not solution as I see it (short of Re# and 3rd party tools),
    this seems to be the IntelliSense not being as smart as the compiler case, as @Rick suggested.

    Or rather – compiler takes its time to resolve things (with all the info at hands), while IntelliSense does not have that ‘depth’ and insight into things (I’m guessing, simplifying really – we need @Eric on this:) and makes fast/easiest choices sort of.

    Actually, on my previous thought,
    it’s more about the ‘job’ that each perform – and IntelliSense (as a completion ‘service’) has to present you with all the choices (both the property name and the type) in the list (I don’t see them both being present, but a guess. And having one choice to cover both would probably be a pain to handle)
    So to differentiate it adds the fully qualified names.
    And where it ‘fails’ (sort of) is to ‘paste’ the ‘short version’ in the end – which indeed it should I think.

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

Sidebar

Related Questions

I am using Visual Studio 2010, but this applies to VS 2008 as well.
Is it possible to change the color of intellisense in Visual Studio 2010. As
Visual Studio 2010 allows toggling the Intellisense mode between the completion mode and the
Possible Duplicate: Will installing Visual Studio 2010 Beta side by side with VS2008 cause
Visual Studio 2010, C#, ASP.NET & SQL Server 2008 are my main development tools,
With Microsoft HPC Pack 2008 R2 installed and using Visual studio 2010 professional, I
Question: Assume a C++ hello world program, non .NET. With Visual Studio 2005/2008/2010, how
In Visual Studio 2005, 2008, and 2010, is it possible to define an Item
I just converted a project from Visual Studio 2008 to 2010 and all of
In Visual Studio 2008/2010 it's possible to place a series of simple .cs code

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.