Visual Studio IDE

Announcement: Last fall, we migrated this forum to Visual Studio Developer Community to provide you one convenient and responsive system for all feedback. As the final step in the migration, this forum will be closed off completely on June 1st, 2019. We encourage you to visit Visual Studio Developer Community where you can now suggest new ideas, browse and vote on existing ideas, and engage with Visual Studio teams.

We’d like your suggestions and ideas to help us continuously improve future releases of Visual Studio, so we’ve partnered with UserVoice, a third-party service, to collect your feedback. Please do not send any novel or patentable ideas, copyrighted materials, samples or demos for which you do not want to grant a license to Microsoft.

This site is for feature suggestions; if you need to file a bug, you can visit our Developer Community website to get started.

Note: your use of the portal and your submission is subject to the UserVoice Terms of Service & Privacy Policy and license terms.

We look forward to hearing from you!
- The Visual Studio Team

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. Warn user when declaring variable in loop

    By accident I sometimes put a variable declaration in a loop - eg

    foreach(var thing in things)
    {
    var x = "something: " + thing.whatever;
    }

    There I should have declared the variable first outside the loop. I think this is probably a common mistake - and can take a while to debug because you often just don't see it.

    Visual Studio should show a warning / underling the text and alert the user.

    0 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  2. "throw return" pattern as alternative to "async-await"

    What I think would be a nice addition to C# would be recognize return as a special keyword of throw, so that you can completely unwind the stack upto the point where UI entered and return a value without raising an exception. This would allow a user to start an async task, add a few continuations to this task, then "throw return" back to the top of the stack to the UI...without using the async keyword at all. Example:
    void XYZ_Click(…) {
    if (DeeplyNestedFunction() == 1) {
    ...
    }
    else {
    ...
    }
    }

    int DeeplyNestedFunction() {
    if (...) { …

    0 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  3. Expand the Things That Can Be Renamed

    It would be lovely if I could rename (via ctrl+r, ctrl+r) dictionary accessor notation. My use case would be something like ViewState[ "someKey" ]. If I highlight that in it's entirety, it would be nice to be able to use the rename to change all instances to ViewState[ "someOtherKey" ]. It would have to require selection of the braces at the least to avoid mangling matching text in other strings.

    3 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  4. Attribute based decorators

    Python allows you to use an @mydecorator syntax (which is effectively an attribute that can be placed above a method).. This indicates when executing the decorated method should get wrapped it in an outer method. it makes AOP programming really easy. It also makes it explicit that the method or methods within a class have been decorated and with what. Decorators can also be chained by using multiple attributes.

    In C# the wrapping would have to be performed at compile time rather than at execution time, but that would still be very very useful.

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  5. Shortcut for creating tasks

    Map this:

    static Task MethodAsync() {
    Task A = new Task(() => {
    Console.WriteLine("A:begin");
    for (int i=0; i < 10000; i++) {
    Console.WriteLine("A:{0}", i);
    }
    Console.WriteLine("A:end");
    doneA = true;
    });
    A.Start();
    return A;
    }

    Into this:

    static TaskNew MethodAsync() {
    Console.WriteLine("A:begin");
    for (int i=0; i < 10000; i++) {
    Console.WriteLine("A:{0}", i);
    }
    Console.WriteLine("A:end");
    doneA = true;
    }

    0 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  6. It would be nice to be able to have arrays of strings in structs.

    It would be nice to be able to have arrays of strings in structs.

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  7. eliminate the using clause

    Instead of requiring using blocks, use the ~ operator in front of variable. Call dispose when the object goes out of scope.

    ~DataContect myDB = ....
    ~TextReader myfile = ...

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  8. null-conditional operator should initialize out var

    aa?.bb(out var cc)

    is a legal syntax, but you end up with a 'cc' that you cannot access since it can be uninitialized.

    If null-conditional operator is used, I think there would be no harm if compiler initializes out var variables to the default value (null).

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  9. new namespace

    namaspace vsualbasic

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  10. Make C# local functions stand out in the editor

    C# local functions is a nice feature that I like to use. But I find it difficult to visually identify such a function within a method. I would be nice to make them stand-out, using a different background, a border, or a left bar...

    2 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  11. Add the "isnt" keyword

    Simple suggestion, please add a new keyword: "isnt"

    This would make code clearer and more readable. So rather than

    if (!(myObject is ClassType)) { ... }

    you would write

    if (myObject isnt ClassType) { ... }

    Looks clearer and provides a positive match rather than a negative match.

    2 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  12. Please provide the ability to open a class by name

    Missing the ability to have a window with all classes and to open a class by name like eclipse has

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  13. Allow null-coalescing event chains in C# (var.someEvent += this.Event?.Invoke())

    Please add syntatic sugar to easily chain compatible events from a member or variable to invoke an event on the current class.

    Binding directly to the event works, but is not null safe.

    c.ChildEvent += ParentEvent.Invoke;

    Having a lambda expression works, but is unnecessarily verbose.

    c.ChildEvent += (sender, e) => ParentEvent?.Invoke(sender, e);

    A null-coalescing operator would be useful here, even if just syntactic sugar.

    c.ChildEvent += ParentEvent?.Invoke;

    https://dotnetfiddle.net/Zbx0wq

    using System;

    public class Parent
    {
    public event EventHandler ParentEvent;


    public void DoSomething() {
    var c = new Child();

    //Works, but not null-safe.
    c.ChildEvent += ParentEvent.Invoke;

    //Null safe, but verbose.
    c.ChildEvent +=…

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  14. Replicate the TSQL 'IN' Clause

    Instead of adding several Or clauses to an if statement that all check the value of the same variable, it would be great if you could write some syntax similar to the TSQL 'In' clause.

    So, instead of writing this:

    int test = 5;
    if (test == 6 || test == 17 || test == 82)
    {
    //code
    }

    You could write something like this:

    int test = 5;
    if (test in (6 || 17 || 82))
    {
    //code
    }

    https://docs.microsoft.com/en-us/sql/t-sql/language-elements/in-transact-sql?view=sql-server-2017

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  15. Don't make a coding standard default behaviour.

    I have a visual impairment that means I cannot see as clearly as other people and some parts of my vision are patchy. I would like a way to switch off the automatic variable names as this is causing me a lot of problems. Due to my eyesight I am not able to view the difference between lower case and upper case lettering. Visual Studio C# automatically 'corrects' my local variables to lowercase even after I have prefixed them with a letter L (L for local). I know this default behaviour is a coding standard that most people use but…

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  16. Fix the "Quick Find", “Find” and "Find and Replace" dialogs

    Please fix the "Quick Find", “Find” and "Find and Replace" dialogs, as follows:

    Change "Look In" GUI, from a drop-down list to radio buttons. Doing this will reduce the number of mouse clicks from 2 to 1.

    This is important, because I use this dialog quite often (as I expect do other programmers).

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  17. Generic class type inference

    Implement what's known as "The Diamond" in Java:

    Box<Integer> integerBox = new Box<>();

    Replace the type arguments required to invoke the constructor of a generic class with an empty set of type arguments (<>) as long as the compiler can determine, or infer, the type arguments from the context.

    0 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  18. Enhanced generic constraints: Interfaces, Enums, numerics

    This rolls up various requests and adds some more.

    Quite simply, generic constraints are beautiful - but incomplete.

    Please fill in the gaps and let a class be declared with constraints as follows:

    public class Subclass<TInterface, TEnum, TNumeric>
    where TInterface : interface
    where TEnum : enum
    where TNumeric : double, float, int, long // or some metaword for these
    { ... }

    9 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  19. Bitarray CopyTo long or uint

    Add a BitArray.CopyTo(uint[]) and BitArray.CopyTo(ulong[]) overloading.
    I have the problem that i have a BitArray with 48bit, which can have all bits to true. If i want to copy it to a ulong it's not a simple converting. A uint or a ulong are a naturally representation of a BitArray.

    0 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  20. Help visual studio refactor assist by marking classes or namespaces as "don't suggest adding here"

    TL;DR - Is there a mark down or way to tell Intellisense that I'd rather it not suggest adding public fields in internals only shared project?

    I have a shared project that contains internals that I'd rather not have exposed to developers. I have multiple public nuget packages that inherit this shared project.
    I need to re-factor a complex generic class between these two now (but it can't be exposed to users, they shouldn't know the details of our async structures, just a single method call). The final generic constructor that accepts base classes that need to be derived in…

    1 vote
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →

Feedback and Knowledge Base