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: http://connect.microsoft.com/visualstudio.
ASP.NET Runtime/Web Tooling suggestions have moved! All your ideas, including your votes, have been transferred and are searchable in the ASP.Net Uservoice forum. Please submit any new ASP.NET Runtime/Web Tooling suggestions, or vote on existing suggestions by going to http://aspnet.uservoice.com.
We look forward to hearing from you!
Thanks – Deon Herbert
Visual Studio Team
-
More robust anonymous types (a la F#)
F# has object expressions, which act like Java's anonymous types:
ISomeInterface v = new ISomeInterface {
public void InterfaceMember() { ... }
};C# could profit considerably from having this feature as well, making it much less verbose to implement, say, an IComparer by allowing the programmer to do it in-line.
6 votes -
Negative "is" in examples
In C# Help, for the keyword "is",
include example of negative test,
IE:DateTime datum = DateTime.Now;
object obj = datum;
if (!(obj is DateTime))
{ Console.WriteLine("if (!(obj is DateTime))"); }
else
{ Console.WriteLine("else // (!(obj is DateTime))"); }I had to test several possibilities:
if (obj is not DateTime)
if (obj ! is DateTime)
if (!obj is DateTime)
before I found one that worked.
Is ther a more elegant way to test for a negative "is"?Andrew McCauley
6 votes -
Screenshot function support for Windows Phone in ACTUAL device
Why Windows Phone only support screenshot funtion in emulator only?? That's really odd. When user wants to report a bugs to developer and wanna show actual screen shot, do they have to being a camera and take actual photo?? It would be really good when they have a screen shot function, so when user has noticed there is bugs, make them report to developers directly via outlook app in windows phone
6 votes -
6 votes
-
Allow Indexers as extension methods
It would be very handy to be able to define indexers as extension methods in C#.
6 votes -
define null coalescing assignment operator (??=)
instead of having to type:
nullableInt = nullableInt ?? 0;
let me do this:
nullableInt ??= 0;
6 votes -
Add inheritance for xml documentation from base class/interface
It would be very convenient if you could declaratively inherit documentation from a parent interface/base class so that you don't need to keep documentation updates in sync in multiple places.
Something along the lines of /// <inherit source="FirstParent" restrict="Project" /> type of tag where the source is an enumeration saying how high up to go until it finds documentation (parent/first parent with documentation, abstract class, interface, etc.) and restrict being an enumeration to restrict it to a project/solution/referenced library/bcl.
Typically I would only use this for documentation inheritance between a class and it's interface, but they may not necessarily be…
6 votes -
add a setting for different colors of identifiers, properties and methods to C# into Fonts and Colors settings
For C++, it is already supported.
6 votes -
Add more informations if WCF services client generation failed
If the service client generation failed and the reference.cs is empty I dont get correct information about the error in VS
If I set logging in config file in the most cases I find the description of the problem in the log file but it is too cumbersome...5 votes -
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() { ...…5 votes -
Add support for generic operators
C++ and the CLI currently support generic operators, C# does not and can't use them.
5 votes -
Second syntax of the switch statement
double mydouble, dblA, dblFrom, dblTo;
<code>
switch(mydouble)
{
....case(dblA, dblFrom .. dblTo)
....{
........Console.WriteLine("variable or variable range");
....}
....case(5.7 >< 8.3)
....{
........Console.WriteLine("between");
....}
....default
....{
........Console.WriteLine("default");
....}
}- there is no fall through of course but there are branches
- each branch of a block{} or a single statement (like the if)
- variables can be used (not only constants)
- range and between operators can be used (frequent testing)
- comfortable, comma-separated expression lists for the cases
- the new syntax fits into the C# style (see try-catch, if)
- do not need new C# keyword
-…5 votes -
Add index to foreach statements
Add index to foreach statements so developers don't have to declare their own indexes to track counts.
5 votes -
infoof operator returning MemberInfo
The idea of an infoof operator is, to simplify reflection.
Example for a Property:
infoof(MyClass.MyProperty) returns PropertyInfo
Examples for Methods:
infoof(MyClass.MyMethod)
infoof<gen0T, gen1T>(MyClass<gen0>.MyMethod<gen1>, paramType)Examples for ConstructorInfo:
infoof(MyClass)
infoof(MyClass, param1Type)
infoof<genT>(MyClass<genT>)Where typeof returns a Type for a class, the infoof returns a ConstructorInfo for a class.
The infoof operator returns all other MemberInfo's, except of Type.I'm sad of enumerating members, validating by name string and by enumerating generic arguments and parameters to get a member I need to invoke or qualify.
This way, doing reflection would also become strong typed.
5 votes -
New scope for object initializers
Many times when using classes, I find myself wishing I could set read-only properties in the object initializer block rather than being forced to pass them to the constructor:
var myObj = new MyObj
{
ReadonlyProperty1 = "hello",
ReadonlyProperty2 = "world"
}This is currently not possible, since you can only make the setter public or mostly inaccessible from whatever scope you're in (even protected is fairly limited). Perhaps you can introduce a special scope modifier "init", which allows an otherwise inaccessible property setter to be visible only in the object initializer block:
public class MyObj
{
public ReadonlyPropery1 {…4 votes -
Allow the use of mathematical symbols in identifiers
When writing algorithms, I try to stay as close to the mathematical definition of an equation as possible.
This mostly requires discipline on my part to define, and use, types and operator overloading, not succumb to premature optimization etc. etc.
I realized the other day that C# code is stored in UTF-8, which has a lot of mathematical symbols.
I would like to be able to write:
var sₖ = new Matrix();
var sₖᵀ = Matrix.Transpose(sₖ);
var c₁= sₖᵀ * sₖ;
Interestingly enough, C# already allows you to use non-ascii letters (like European accented characters) in identifiers. This is of…
4 votes -
operator .?
A cross between the dot operator and the opposite of the ?? operator. "If null, then use null; else, continue with the dot operator."
Current code: return a == null ? null : a.b;
New code: return a.?b;
4 votes -
CacheOption dependency property for Image-control
Create dependency property for Image-control concerning the CacheOption so you don't need a custom converter when using a path-to-ImageSourcebinding
4 votes -
Dictionary initializer syntax
Please add dictionary initializer syntax similar to Python, JavaScript and other dynamic languages have. It would be very useful to create some set of properties.
The way MvcContrib project uses anonymous types is an example of a good use for such syntax. While anonymous types and Reflection is a workaround it is very slow compared to initializing dictionary (~10 times slower). The types of keys and values could be determined by the common ancestors (same as in array initializer syntax) or the created dictionary mat be non-generic (e.g. Hashtable).Example:
IDictionary<string, object> d = new[ , ] {{"Hello", "World"}, {"Count",…4 votes -
Add a Code Viewer that Doesn't take X Minutes to load
Some times I need to quickly look at a code file and can't wait five minutes for Visual Studio to load on my Six Core Machine. So I open it in NotePad. There really should be a lean C#/C++ what ever quick launch code viewer that launches automatically when I click on a C# File. Visual Studio should only open solutions and projects. Not loose code files.
4 votes
- Don't see your idea?