Visual Studio

Welcome to the Visual Studio UserVoice site! Let us know what you would like to see in future versions of the Visual Studio suite of products. This site is for suggestions and ideas. If you need to file a bug, visit the Visual Studio Connect site: https://connect.microsoft.com/visualstudio.

We would also like to invite you to check out the Announcements section we have added to this site, where we will be posting special opportunities for you to participate in.

We look forward to hearing from you!

The Visual Studio Team
Terms of Service and Privacy Policy

NEW! Announcing Limited Preview for Visual Studio Online Code Search

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 vote and comment on it.

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

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

  • Hot ideas
  • Top ideas
  • New ideas
  1. Dynamic generic calls and type conversions

    Let C# do:
    1. dynamic generic calls.
    2. dynamic type conversions.

    Example:

    public void Method(object a)
    {
    int r = ExternalGenericFunc < a.GetType() > ( // dynamic generic call.
    (a.GetType())a // dynamic type conversion.
    );
    }

    // In another DLL, in a non modifiable code:
    public int ExternalGenericFunc<T>(T data)
    {
    return ...; // do something on data.
    }

    7 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 →
    • Consider my detailed proposal for non-nullable references (and safe nullable references)

      Here are the benefits very briefly:

      1. Minimal syntax changes.
      2. Null reference exceptions eliminated.
      3. No changes to code compilation as such (only introduces compiler error checks).
      4. Existing code will continue to compile unchanged.

      See my full proposal at:
      https://github.com/dotnet/roslyn/issues/227

      7 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 →
      • inline anonymous enum

        I would to use inline anonymous enums with C#
        For example instead writing:

        public class PutPaySheetRequest
        {
        public PutPaySheetMode Mode { get; set; }
        public enum PutPaySheetMode { Live, Test };
        }

        I would write:

        public class PutPaySheetRequest
        {
        public enum {Live,Test} Mode { get; set; }
        }

        7 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 →
        • Anonymous type definition

          Allow c# to define types in inline way. For example I have a web api action that returns a Dto. I have to define action as:

          public class Dto
          {
          public int Key {get; set;}
          public Group Value {get; set;}
          }

          action:
          public Dto GetDto()
          {
          ...
          }

          I suggest to write action method as:

          public {int Key; Group Value;} GetDto()
          {
          ...
          return new {Key = key, Value = group};
          }

          Also C# can defer type from action method. So this code can be valid:

          public anonymous GetDto()
          {
          ...
          return new {Key = key, Value = group};
          }

          7 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 →
          • Provide a keyword to restrict accessing a member function if the calling class does not implements specific interface in .Net (C#)

            Provide a keyword to restrict accessing a member function if the calling class does not implements specific interface in .Net (C#)

            For example:
            The class which implements IProfessor only can access IStudent.SetGrade method. If other class try to access, then Compiler should show error.

            7 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 support for Multiple parallel Console windows.

              It would be something like
              Console c = new Console();
              Console b = new Console():

              c.WriteLine("diagnostic output1");
              b.WriteLine("diagnostic output2");

              I assume they would be inherently on their own threads.

              7 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 →
              • lazy struct-property assignments

                When you have a struct accessible as a property inside another object and you wanna change one value inside of that struct, you always need to create a new object with the same values.

                for example, you have a struct "Vector2" storing an X- and Y-coordinate and you wanna increase the X-Value by one, you would have to write:

                myObject.Position = new Vector2() { X = myObject.Position.X + 1, Y = myObject.Position.Y, };

                this syntax is very annoying and hard to read. i would suggest something like this:

                myObject.Position { X = myObject.Position.X + 1, };

                this would mean: a…

                6 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 protocols in addition to interfaces

                  Currently we have interfaces, which are the only way to port code around and reuse it. However, I'd like to see something more like what Go has, where any object which, at compile time, can be verified to support all methods/properties required by the target protocol, the assignment will be allowed. This would be enable much more composable and expressive usage of anonymous types, in particular. Consider:

                  public protocol Prot
                  {
                  int Func1(int x, int y);
                  string Func2();
                  string Prop;
                  }

                  and then these methods (could be in different classes):

                  void DoSomething(Prot p) { ... }
                  string SomeString() { ...…

                  6 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 →
                  • 6 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 →
                    • Property tempate feature [More reusability, readability, DRY principle. Reduce redundant code. Solve default value issue]

                      I suggest a feature that help us to create similar propeties.
                      We frequently create properies something similar like this.

                      public String NVarCharColumn
                      {
                      get
                      {
                      return _NVarCharColumn;
                      }
                      set
                      {
                      if (Object.Equals(value, _NVarCharColumn)) return;
                      _NVarCharColumn = value;
                      this.OnPropertyChanged();
                      }
                      }

                      I suggest property template feature in C#6.0.
                      We can declare property template like this.

                      public property T MyObservableProperty
                      {
                      get
                      {
                      return field;
                      }
                      set
                      {
                      if (Object.Equals(value, field)) return;
                      field = value;
                      this.OnPropertyChanged();
                      }
                      void OnPropertyChanged();
                      }

                      field is a keyword that means private field that will be generated automatically by compiler.
                      T means a type that is used…

                      6 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 →
                      • C#: implement "fat arrow" lambda syntax for property getters and setters

                        // For accessing this private member
                        private string _sMyDesk;

                        // I want to write the code as:
                        public string DesktopName { get => _sMyDesk }

                        // instead of:
                        public string DesktopName { get { return _sMyDesk; } }

                        6 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 →
                        • let C# type inference downcast to a 'common supertype'

                          interface A
                          class B : A
                          class C : A

                          A a = condition ? new B() : new C();

                          Compiler fails because it tries to cast B to C (or was it vice versa?).
                          Daft workarounds: either cast one (or both) of the instances to A, or use an 'if' statement instead of the ternary operator.

                          The two types B and C have a clear 'smallest common supertype' A. So come on MS, how hard can it be to determine the intersection of the class hierarchy of the 'then' and the 'else' branch? Look at the source code of…

                          6 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 →
                          • I would like to see that the C# editor and compiler get XML support.

                            I would like to see that the C# editor and compiler get something like XML support. It is very simple to integrate and extremely helpful at development time and furthermore, it allows unbelievably powerful new futures. Please check the attachment and for the case that it is interesting I could send test application and code examples.
                            (I wrote an own c# compatible Compiler for fast runtime compilations)

                            Regards from Germany
                            Christian Ohle
                            Free programmer

                            6 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 new C# statement for case-insensitive "switch()"

                              I've previously posted this on Connect - https://connect.microsoft.com/VisualStudio/feedback/details/566079/add-new-c-statement-for-case-insensitive-switch

                              The C# 'switch' statement does not allow for performing any kind of case-insensitive comparison for 'case' values.

                              6 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 class methods/properties/fields to C#

                                The way static methods/properties are implemented in C# has a number of severe limitations. As they are not associated with the type itself, they cannot be virtual or abstract, and thus cannot be overridden, or inherited in the normal sense. This makes it much ****** to abstract some piece of type-specific functionality into a base type that the children can then provide their implementations of.

                                Eric Lippert gives a brief description of the feature here:
                                http://blogs.msdn.com/b/ericlippert/archive/2007/06/14/calling-static-methods-on-type-parameters-is-illegal-part-one.aspx

                                Example of feature (based on a real-world scenario):
                                public abstract class Definition<T> where T : Definition
                                {
                                public abstract static T GetDefinition();
                                }

                                public…

                                6 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 →
                                • Variant of switch that throws exception if nothing matches

                                  I get sick of writing

                                  default:
                                  throw new ApplicationException(value.ToString());

                                  at the bottom of every switch statement where I know a match should occur, but want to stop the compiler complaining about unitialised variables. I suggest something like:

                                  switch checked (value) {
                                  ...
                                  }

                                  6 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 →
                                  • async call syntax for Begin... / End....

                                    IAsyncResult ar = async (int n = Receive(buffer))
                                    {
                                    Console.WriteLine("Inside the callback after EndReceive");
                                    }
                                    Console.WriteLine("BeginReceive= {0}, but callback not called yet", ar);

                                    Like get_Property, put_Property, or Item property.
                                    Like try {} finally {x.Dispose();} was converted to using {}

                                    6 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 →
                                    • 6 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 →
                                      • Cancel Build Proccess

                                        Cancel Build - I accidently select build, then immediately realize I forgot something

                                        6 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 →
                                        • Support chat rooms that allow for immediate discussion and are newb friendly

                                          While learning ASP.Net MVC 4 and C# I sometimes either get stuck on a topic or have further questions. Often times I have to quit studying for a day just to wait for an answer on something that I'm stuck on which is completely unrealistic and unproductive.

                                          My first impulse is to go to the freenode IRC channels for ##csharp or ##asp.net but usually the channel is dead (especially in the evening) or no one cares about my newb questions (it even states "no spoonfeeding" upon entering). Sometimes there isn't even anyone there that knows MVC. IRC used to be…

                                          6 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 9 11 13 34 35
                                          • Don't see your idea?

                                          Feedback and Knowledge Base