This weekend I added a suggestion for a new simple but powerfull feature in the next version of Visual Studio. In my opinion it’s a pretty good one (otherwhise I wouldn’t have posted it anyway), so I thought perhaps you agree on this. Feel free to vote and help me get this one up there.
Suggestion text after the break.
I suggest you… automatically fix fixable errors
Some errors in the error list could be automatically fixed. For instance, you build your code and the error “The type ‘bla’ is not referenced. You must add a reference to assembly ‘System.Data.Entity'” appears in the error pane. This error is easily fixed by adding the correct reference to the project, but since Studio already knows what it’s looking for, it knows where it’s located (GAC), why isn’t there an option to fix it?
It would be nice if the error pane would have a column “Autoresolve” with for each error which migh be fixable a link “Try resolving”. Studio would then try to autoresolve the problem, for instance by adding the correct reference to the project and all would be well. If there was a problem resolving the problem, Studio could display an error message telling the user the autofix didn’t work and he should correct the problem himself.
In the same category, auto fixes could be applied for things like missing/extra parentheses, ; characters, etc. etc. I think the list of autoresolvable things is actually pretty long.
But please note: VS should NEVER do this on it’s own. It should always be the developers action to perform an autoresolve.