Visual Studio IDE

Announcement: This forum has been migrated to provide our customers one convenient and responsive system for all feedback. You can now suggest new ideas, browse and vote on existing ideas in the Visual Studio Developer Community. To learn more about the migration to Visual Studio Developer Community please check out the release blog post.

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. Don't require "async" keyword for the methods with "awaits" in the body

    This is misleading. This looks like a part of method signature but this is not. The only thing it does is: it enables awaits in the method body. This requirement looks the same as if you would require "enable_yield" keyword for the methods with "yields":

    public enable_yield IEnumerable<int> Foo()
    {
    yield return 42;//yield is enabled
    }

    public IEnumerable<int> Bar()
    {
    yield return 42;//compiler error
    }

    The "async" tells nothing new for the caller - the caller already knows that the method returns Task.
    If the method returns "void" - anyways any methods can start threads, enqueue work items to the…

    63 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    13 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  2. Make Visual Studio suggest explicit type instead of var when ToList is called

    This suggestion is migrated to Developer Community. Please use below link to view the current status.
    https://developercommunity.visualstudio.com/content/idea/351488/make-visual-studio-suggest-explicit-type-instead-o.html
    Currently when the .editorconfig or the Visual Studio settings say that the code should prefer var when the type is apparent Visual Studio suggest that I change code like this

    List<string> test = Enumerable.Range(1, 2).Select(i => i.ToString()).ToList();

    I should use var because the type is apparent. It does this even when I have code like GetItems().ToList(); While calling ToList makes it apparent that the type is a List<T> it is not the List that I care about, it is the T. This is…

    60 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 →
  3. 'number' type

    BigInteger and decimal are annoying. So verbose and with BigInteger we must create a class, the parameter is an string, etc.

    "number" will be a dynamic type which accept infinite integers and decimals, and he only can be a number.

    How to use:
    number variable=Int32.MaxValue+999; // > Int32
    variable=2.333333333333; // BigInteger to decimal without casting

    If C# adds this Python feature, he will be the best language ever.

    58 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 →
  4. 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

    57 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 →
  5. Generic this

    Please add support for a generic 'this', to use in (generic / abstract) types or interfaces.

    The "this" would reflect the current type and is used as an generic constraint. This would create new cool possibilities with C#.

    For example, the `ICloneable` interface has one method (Clone), which returns an `Object`. This is undesirable because:

    - We need to cast the result (most of the times) - bad for the performance and could lead to run-time errors.
    - We could implement the Clone method more easiliy wrong: the Clone method could return the wrong type (not compile time enforced)
    -…

    57 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  6. Make BulkObservableCollection<T> public to the core .NET Framework

    Using WPF and ObservableCollection<T> has serious performance issues if you need to add large sets of collection items at once, which is well known today. Each updated item fires multiple events that have significants performance costs.

    There are hundreds, if not thousands, of custom implementations on the net to overcome this problem and that have their own, more or less adventurous, way of adding a new "AddRange()" method that does not fire all those events for each element but only once once at the end up the collection update.

    There is already an existing implementation written by Microsoft, the BulkObservableCollection<T>…

    48 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 →
  7. Add option to prevent indentation of classes inside namespaces in C# code

    The option is there for C/C++ but not in C#. Please add it in C#

    47 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  8. Add async foreach to C# and IAsyncEnumerator to .NET

    • C# feature 1 (foreach-await):

    foreach (var item in AWAIT asyncEnumerable) { ... }

    • .NET interfaces

    public interface IAsyncEnumerable<T> : IEnumerable<T> {
    IAsyncEnumerator<T> GetAsyncEnumerator();
    }

    public interface IAsyncEnumerator<T> : IEnumerator<T> {
    Task<bool> MoveNextAsync();
    }

    • C# feature 2 (async-yield):

    async IAsyncEnumerable<XmlNodeType> TokenizeXmlAsync(XmlReader reader) {
    while (await reader.ReadAsync()) {
    yield reader.NodeType;
    }
    }

    • Why

    Imagine a scenario when you run a SQL query and read results row by row, but you don't won't to block a thread in your app because you are waiting on a reader to read and parse the next row from the network stream, and…

    43 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 →
  9. Provide official logos for the .NET languages

    This suggestion is migrated to Developer Community. Please use below link to view the current status.
    https://developercommunity.visualstudio.com/content/idea/351363/provide-official-logos-for-the-net-languages.html
    We need something to stick on our laptops.

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

    Hey Niklas,

    Cool suggestion. We actually do have, or at least had, logos for the .NET languages and stickers bearing them. I have one for VB on one of my laptops and one of each for VB, C#, and F# on another. We used to give these out at conferences and events, I’m not sure if we ran out. At times we’ve also had T-shirts and mugs. Everyone’s always asking us where they can get them. We really should put up a storefront somewhere so that all our fans can show their love. I’ll get on that and let you know what we come up with.

    Regards,

    Anthony D. Green, Program Manager, Visual Basic, C#, and F# Languages Team

  10. Allow the C# 'break' statement to terminate *several* nested enslosing loops, rather than the closest one only

    Sometimes, I want to exit several nested loops, based on a single condition.

    Today, I have to introduce an additional boolean variable, to exit all the other loops except the innermost one. This is inconvenient.

    If only the 'break' statement could have accepted the number of loops to break...

    A straighforward example:
    for(;;)
    {
    for(;;)
    {
    if{true} break(2);
    }
    }

    This feature would work just similarly when used in a 'switch' statement.

    We would only have to be concerned to not allow the 'break's parameter to exceed the number of nested scopes it is used from within. Otherwise, an error…

    40 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    12 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  11. Get rid of IDE0017 C# Object initialization can be simplified

    I recently switched to VS 2017 RC as my primary development mode because I read it was production ready.

    Now every class I compile you try and show me a warning, 'Object Initialization Can Be Simplified'.

    Get rid of this warning, or at the very least make it something that has to be turned on, do not turn it on by default.

    You can't just introduce something that breaks 12 years worth of C# code in our code libraries.

    41 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    10 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  12. DllExport attribute

    I think we need a DllExport attribute to mark methods, that we need to export from managed DLL to unmanaged code so it can be used by c++ applications. There is many places when it can be usefull. For exaple to support old c++ applications with c# libraries. Currently to export a method, we need to go to IL code and add export attribute. This is quite annoying and time consuming. It will be nice if c# compiler will do it by itself

    39 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  13. Support String Interpolation in Resources Project Items

    I think that it would greatly simplify internationalization efforts if Resources project items would support the notion of interpolation of values. This would build on the existing support for String resources by adding metadata to the RESX file format to describe the names and types of the expected values for the argument holes. The generated designer class would use that metadata to construct methods which would accept those values as arguments and use composite formatting to build the final string.

    For example, an interpolated String resource could be declared as follows:

    Name: Greetings
    Value: "Hello {name}!"

    When this String resource…

    38 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  14. set when

    private bool _flag;

    public bool Flag
    {
    get { return _flag; }
    set when (_flag != value)
    {
    _flag = value;
    OnPropertyChanged();
    }
    }

    37 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 →
  15. Ranged Data Types In C#

    I suggest to improve current numeric types by adding a way to set a value range. This can be done by some attributes, but it will be easier to give it a syntax like this
    C#:
    [5,10]int i;
    VB.NET:
    Dim i As Integer[5,10]
    The compiler must not allow I to have any value < 5 or >10.
    One can omit one limit:
    [,100]byte
    [13,]int
    This will make it easy to write auto-properties like this:
    C#:
    [18,30]int Age {get; set;};
    VB.NET:
    Property Age As Integer[18,30]

    Another Syntax Suggestion:
    C#:
    <5,10>int i;
    VB.NET:
    Dim i As Integer<5,10>

    36 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    6 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  16. Actually implement Exception.ToString correctly. E.g. AggregateException.ToString() { foreach( exception in InnerException )

    Actually implement Exception.ToString correctly.

    E.g. AggregateException.ToString() { foreach( exception in InnerException ) print out exception.ToString(); }
    Exception.ToString() { print out error message and stack trace; }
    WebException.ToString() { print out the error response; }

    35 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 →
  17. Using Boolean(bool) as the "enum" Underlying Type

    In the C# and CLR the underlying type of an enum can be any integral type. If the bool(Boolean) type is used, the true/false aliases will be available specially in the ORM classes (for bit datatype).

    For example:
    public enum Gender : bool
    {
    Male,
    Female
    }

    or

    public enum Answer : bool
    {
    No = false,
    Yes = true
    }

    and then:

    Answer ans = Answer.Yes;
    if(ans){
    ...
    }

    35 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 →
  18. Add new string literal that contains Razor code (for example between «»)

    Is time to move forward from String.Format() and inline conditionals, with the new Roslyn would be awesome if we can use some "kind" of Razor in any C# code

    var msg = String.Format("Hi {0} you have won {1} credits", name, creditsWon);

    How much better it will be:

    var msg = «Hi @name you have won @creditsWon credits»

    You can provice intellisense and also an HTML version:

    var msg = @«<div style="margin:10px;">Hi @name you have won <b>@creditsWon</b> credits</div>»

    That option must be multiline too.

    33 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
  19. Implement macro support for output paths (i.e. intermidate and output binaries)

    Simply put: Allow users to redirect where code generated files are stored the way Visual C++ does.
    e.g. Be able to use something like $(VCOutDir)\$(SolutionName)\$(ProjectName)\$(Configuration) to redirect generated binaries to some folder other than where source code is kept.

    33 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 →
  20. lambda function named parameters

    It would really nice if Func delegates could be called/used with named parameters, for example, if:

    public Func<int, int, int> Add = (num1, num2) => num1 + num2;

    -----
    could be used like thi:

    int sum = Add(num1: 50, num2: 60);

    -----------
    (where(num1 and num2 are the named parameters)

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

Feedback and Knowledge Base