Visual Studio 2015

Welcome to the Visual Studio 2015 UserVoice site. This site is for suggestions and ideas for the IDE of Visual Studio (Community, Professional or Enterprise). You can also add suggestions for Team Services or Visual Studio Code. Or go to Connect to file a bug. Note that Application Insights has moved to its own UserVoice forum.

We also added an Announcements section where we will be posting special opportunities for you to participate in.

Read about current UserVoice statuses and their definitions in our article “What Does the Status of My Feedback Mean?” article.

We look forward to hearing from you!

The Visual Studio team
Terms of Service and Privacy Policy

I suggest you ...

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Add TryParse() method for MailAddress object

    Currently the only way to know if an email address is valid is to either create a complex regular expression, or try to add an email address to the MailAddress object, and catch any thrown exceptions.

    I wrote an extension method against the string object to validate if the string is a valid email address.

    public static class MailAddressExtensions
    {
    public static bool IsValidEmail(this string input)
    {
    try
    {
    if (string.IsNullOrWhiteSpace(input))
    return false;
    new MailAddress(input);
    return true;
    }
    catch (FormatException)
    {
    return false;
    }
    }
    }

    Another option would be to implement a method to allow extension methods on an…

    4 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
    • Group Extensions Methods together for better Intellisense (ie foo.Linq.Single())

      Adding extension methods like Linq make intellisense almost unusable... just too many options with no organization.

      So how about an attribute on the using statement (ie)

      [ReferenceAs("Linq")]
      using System.Linq;

      [ReferenceAs("MyHelpers")]
      using HelpersLib.Extensions;

      This will group all the extension methods together so instead of:

      foo.Where(..)
      foo.ToCleanInt()

      You have...

      foo.Linq.Where(..)
      foo.MyHelpers.ToCleanInt()

      So instead of hunting through 50 different extension methods, you could narrow them down easily.

      4 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
      • Make ToDictionary report the offending key in case of duplicates

        Right now the message we get is "An item with the same key has already been added.".

        I would find it really helpful if it could include the key that it was trying to add.

        4 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
        • Provide internal methods to Interface contracts.

          I'm in the process of rewriting engine code for a game. And something that keeps appearing is the need to describe interfaces with internal methods. Often, game code must build objects that meet an interfaces contract, and that contract often includes the provision of internal methods such as Render().

          C# interfaces currently don't provide this feature, and it's a real shame, because it makes sense to build against these contracts with internal methods, and not having to resort to using inheritance.

          There is no reason a contract can't say 'provide an internal method for Render() because all Models require it…

          4 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
          • repeat keyword

            working with loop. sometimes you need to repeat something again. in this case you have to reduce/increase the counter or use goto statement.

            i was thinking that using repeat keyword would be nice.

            foreach(var v in list)
            {
            // do something
            if(...)
            {
            repeat; // iterate and dont go for next element of list.
            }
            }

            4 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
            • if (var item = someObject as someClass) {...}

              Combine "is" and "as" - extend "if".

              instead of
              if (someObject is Someclass)
              {
              var item = someObject as someClass;
              ....
              }

              simplify to
              if (var item = someObject as SomeClass)
              {
              ...
              }

              the expression would fail if item is null (i.e. someObject is not someClass).

              Or use separate keyword for such construct.

              Possible implementations : treat definition with assignment as expression, or just extend "if" expression syntax.

              4 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)
                You have left! (?) (thinking…)
                2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
              • lazy

                I would like to see lazy properties in C#. This is a common pattern for me:

                public class MyClass
                {
                public string MyProperty
                {
                get
                {
                return _MyProperty.Value;
                }
                }

                private System.Lazy<string> _MyProperty = new System.Lazy<string>(() =>
                {
                return "Some string";
                });
                }

                This could be simplified with a keyword "lazy":

                public class MyClass
                {
                public lazy string MyProperty
                {
                get
                {
                return "Some string";
                }
                }
                }

                4 votes
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                • can we remove Tuple object item1 or item2 and puts our custom name

                  its very hard to under stand every time in Tuple like item1 or item2 which one belong to which column or property, menas every time we need remember like on first string datatype is belong to name or id etc.
                  if we can put our custom name for tuple object like we can do in generic list name , id , mobile number etc that we will we very helpfull to understand .

                  4 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                    1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                  • Change keyword "interface" to "spec"

                    As the word "interface" means a place for communication between two entities, a user interface to operate something or the means of connecting something to/with something else, I do not see a logical reason to call a specification or a list of methods and their parameters - an interface.

                    Using "interface" as a keyword to define that list is confusing, especially to begginers. Please change it. Thank you.

                    4 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                    • add someting select as target one instance of an object

                      add someting like that:
                      with(myPoint)
                      {
                      X=10;
                      Y=10;
                      }

                      that is equivalent to
                      myPoint.X=10;
                      myPoint.Y=10;

                      why wuld it be useful?
                      insted of doing that:
                      Graphics myGraphics= Graphics.FromImage(myImage);
                      using (myGraphics)
                      {
                      myGraphics.DrawLine([...]);
                      myGraphics.DrawLine([...]);
                      myGraphics.DrawLine([...]);
                      myGraphics.DrawRectangle([...]);
                      }

                      you can just do that:
                      using(myGraphics)
                      {
                      with(myGraphics)
                      {
                      DrawLine([...]);
                      DrawLine([...]);
                      DrawLine([...]);
                      DrawRectangle([...]);
                      }
                      }

                      4 votes
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                        0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                      • Extension classes with Interfaces

                        [I have posted this on GitHub as well]

                        I believe that type extensibility (as in extension methods) is a very useful feature that should be viewed as part of a healthy OOP design and not just as compiler deception or syntactic sugar.

                        Type extensibility can be expanded to the much anticipated extension properties, extension events, indexers etc and even Interface implementation. This last one would be particularly useful should we need to group types owned by others, in interfaces owned by us (or others).

                        The main advantage of type extension is the ability to intervene high up in an inheritance…

                        4 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                        • Add private scope to non nested types to make them only accessbile in same namespace or child namespace

                          Assemblies addresses the physical separation of code while namespaces addresses the logical separation of code. Types can be scoped to assemblies via the internal keyword but they cannot be scoped to namespace. I propose that non-nested types can be declared private which would make them only accessible within same namespace or child namespaces (even across assemblies).

                          I have assemblies that contain multiple namespaces because the functionality is always deployed together. This helps me reduce the amount of assemblies which simplifies deployment, patching, speeds up builds, speeds up visual studio, allows ngen to inline etc. However, internal types are insufficient because…

                          4 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                          • Allow declaration after "is" keyword in "if" statement

                            The following statement has become frequent while coding, so much that being a two-liner is becoming an annoyance:

                            var t = o as T;
                            if (t != null) { ... }

                            A convenient approach to inline this would be:

                            if (o is T t) { ... }

                            Instead of appalling alternative of an assignment-in-if (which would create a myriad of use-cases to cover):

                            if ((var t = o as T) != null) { ... }

                            For reference, a highly upvoted StackOverflow question which covers the matter and proves its frequent use:
                            http://stackoverflow.com/questions/7113347/c-sharp-assignment-in-an-if-statement

                            4 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                            • Add a "self" keyword, similar to PHP's self:: keyword, for accessing static members.

                              In C# if you wish to unambiguously reference a static member locally you must specify the full type name, e.g.

                              class ContrivedName {
                              static void Foo() {
                              }

                              public ContrivedName() {
                              ContrivedName.Foo();
                              }
                              public static ContrivedName Clone(ContrivedName source) {
                              ContrivedName dolly = new ContribedName();
                              dolly.CopyFrom( source );
                              return dolly;
                              }
                              }

                              I find it strange I had to type out "ContrivedName" 3 times in that example. It means I will have to use the Refector-rename functionality should I rename the type to something else, it also makes it more difficult to copy+paste code or other kinds of source-level code reuse.

                              4 votes
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                                1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                              • var null initialize

                                I write code like so:

                                string newFishName = null;

                                or

                                var newFishName = (string)null;

                                because I can't write

                                var newFishName = String.null;

                                yet I can write

                                var newFishName = String.Empty;

                                I know it's just a syntactic thing, but for consistency

                                var newFishName = String.null;

                                might look better?

                                4 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                  2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                • Allow overloading of arithmetic assignment operators

                                  This has been addressed may times in various places, but I do not believe that the popular wisdom "this is a bad idea because it allows for non-standard functionality" is a valid objection.

                                  Currently the arithmetic and assignment operators (+=, *=, etc) are syntactic shorthand. That is to say that the generated code for 'x += y' appears identical to the code generated for 'x = x + y' in most (all?) cases.

                                  The '+' operator may be overloaded to perform any arbitrary operation on the operands ('x' and 'y') and the returned value is assigned via reference assignment to…

                                  4 votes
                                  Vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)
                                    You have left! (?) (thinking…)
                                    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Support "interface" constraint in generics

                                    A new constraint for generics allowing to limit the type parameter to an interface type only:

                                    public class MyClass<T> : T, where T : interface
                                    {
                                    // ...
                                    }

                                    4 votes
                                    Vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)
                                      You have left! (?) (thinking…)
                                      2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Make using threads natural in C#

                                      Threading needs to simplified further and made a natural part of the language. Instead of having to create a Task or Thread objects to run code on a new thread, could it not be simplified to something like:
                                      MyMethod(args) on new thread;
                                      or
                                      MyMethod(args) on new thread new_thread_object;
                                      or
                                      MyMethod(args) on thread existing_thread_object;

                                      Using the first option, you lose the thread object, but this could be handy running a process on a form to keep the form responsive.
                                      Using the last option, we could use that to run a method on a form to update controls without have to jump…

                                      4 votes
                                      Vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)
                                        You have left! (?) (thinking…)
                                        1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                      • "IF(Min < x < Max)" instead of "IF(Min < x & x < Max & Min < Max)"

                                        It makes the code more readable and clean.

                                        Maybe there is a way to combine OR-statements too:
                                        "IF(A | B == x)" instead of "IF (A == x | B == x)"

                                        4 votes
                                        Vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)
                                          You have left! (?) (thinking…)
                                          0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                        • nameof for multiple members

                                          In c# 6
                                          string name = nameof(Property); // name = "Property"
                                          string[] names = { nameof(Property1), nameof(Property2), nameof(Property3), nameof(Property4) }; // names = Array of names
                                          I suggest to support the following syntax:
                                          string[] names = nameof(Property1, Property2, Property3, Property4); // names = Array of names

                                          3 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                          1 2 8 10 12 24 25
                                          • Don't see your idea?

                                          Feedback and Knowledge Base