I must say I really like the new code analysis with VS 2010, I have a lot of areas in my code where I am not using CultureInfo.InvariantCultureand code analysis is warming me about this.
I am pretty sure I want to use CultureInfo.InvariantCulturewhere ever code analysis has detected it is missing on Convert.ToString operations.
Is there anyway to get VS to automatically fix warnings of this type?
You cannot do this in VS Code Analysis but CodeIt.Right performs similar analysis (only on source code) and includes auto corrections with every rule. Give it a try!
I don't think you can do that with Visual Studio but Resharper 5 has a Structural Search and Replace functionnality that could work for that.
Related
I have dyslexia and am starting my first collaborative project with other students using the IDE Visual Studio 2013. I fear that my miss spellings may cause errors and annoyance to the rest of the team, so I wish to keep my spelling mistakes to a minimum.
Projects on which I work alone are less of a problem, as if I spell the word wrong I tend to spell it wrong throughout the program in the same way - but I feel I would still get use out of a spell checker for these too.
I have had a google but only found a few plugins, most of which are outdated. Any help is much appreciated.
There is this one that has been updated recently: Visual Studio Spell Checker
You can just add it from VS by going to the Extensions.
Tools -> Extensions and Updates -> Online -> Search box -> Search for Spell Checker
I just tried it out, works well.
If you have ReSharper (highly recommended, but a bit pricey) then I can recommend ReSpeller. Costs only $10 and is completely integrated into ReSharper.
http://etherealcode.com/respeller/
At the same time, I can mention that ReSpeller (at least for the version I have, 2.3 for ReSharper 7.1) has one unfortunate quirk, but it is an option that can fortunately be turned off.
ReSpeller is unexpectedly accepting "prefered" as correct spelling
If you are using the Code Analysis/Fxcop rules built into visual studio you could add the following to your ruleset:
CA1703: Resource strings should be spelled correctly
CA1704: Identifiers should be spelled correctly
CA2204: Literals should be spelled correctly
You can try this too.
I am using this spell checker it is awesome. . .
https://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce
Another spell checker
https://visualstudiogallery.msdn.microsoft.com/F9CDA5D8-10AF-4CC6-9D17-207222A3FD13?SRC=VSIDE
I've heard that Visual Studio 2010 = Visual Studio 2008 + Resharper. I'd like to know how true that is. I don't want to start using Resharper to accomplish superficial things, nor to accomplish things that VS 2010 now already handles. I'm sure Resharper 5.1.X offers features that VS 2010 does not have, but which of those - in your opinion - represent the true value-adds? Which of those "truly-valuable" features are available only in the licensed copy?
This is a 'joke' based on the fact that Microsoft supposedly released a screenshot of 2010 with ReSharper UI visible.
VS.Net 2010 definitely does not go any way towards making ReSharper redundant!
Resharper adds alot to VS2010. Just check out this comparison matrix.
I'm sure Resharper 5.1.X offers features that VS 2010 does not have, but which of those - in your opinion - represent the true value-adds? Which of those "truly-valuable" features are available only in the licensed copy?
All features are available in a non-licensed (demo) copy. Check out this post of what single feature people like about Resharper.
I know this is slightly off topic. However, as a response to whether VS2010 is making Resharper redundant;
I've upgraded ReSharper from 5.1 to 6 roughly 1 month after release. It got slower. To the point when I have to Suspend it occasionally - particularly when doing lots of work on JavaScript, CSS or larger template files (Razor). Sad thing is it just gets slower.
At home, I'm using just a plain VS2010 Professional without any add-ons. And it just feels like a breeze - everything is responsive and there are no hiccups when copy pasting (during manual re factoring). Admittedly at work I have T4MVC and Chirpy installed along Resharper.
Feature wise, what I'm using in ReSharper:
Auto usings (alt + Enter)
Cannot use auto include references as it gets it wrong 80% of the time
Refactor: initialize member variable from constructor parameter
Refactor: replace with LinQ expression
Sadly that's about it. In light of this, because of the slowdowns I'm considering dropping ReSharper altogether. This is my grievances:
Delay every time I copy a piece of code in order to move it - anything from half a second to 2 seconds. Please note the delay increases with project / solution size
Auto completion in JavaScript and CSS: 95% of the time it inserts code I don't want - in particular () after selecting an object property. Getting fed up having to delete the brackets each time
class name and id suggestion. This happens in CSS as well as Razor template. It will try to insert an existing class name / html id when you are in fact creating a new one. It will do this whenever you press space. Instead you have to press escape.
Pasting code. Again when refactoring manually and code is moved from one class to another it will keep pestering you with all missing usings. First you have to press Escape for "Insert all missing usings" and then once for every occurrence of a class without a reference. Usually you want to change something upon pasting code but this feature makes code unreadable with all the popups.
I could go on abut the things I find annoying with ReSharper. Not trying to offend any die-hard productivity tool enthusiasts, bottom line is VS2010 is on it's own a very decent IDE and a lot of ReSharper features can be found within it - though not always intuitively.
If you are just learning C# ReSharper is a great tool that helps you organize your code better. But if you've been working with .NET for a while you will most likely find it intrusive and hampering productivity on some occasions.
Re#er still got much stronger code check and refactoring options.
What Editors/Designers for creating Visual Studio 2010 Snippets are there?
I would like to be able to put in different replacements (ie spots where the text should be replaced). A low incidence of blocking bugs is also nice.
So far the only one I have seen is Snippet Editor 2.1. I am going to dig into it and see how it works, but I did not want to spend too much time on that app if there is a better one out there.
I like Snippet Designer by Matt Manela and chose to use it in my Extending Visual Studio course. I like the Snippet Explorer and searching snippets as well as the designer view to help you edit them, including replacements. It also gives you a nice Export as Snippet context menu item. And the code is on CodePlex if you would like to learn how it's done.
Go to the Visual Studio Gallery and search for "snippet" in the "Find" box. You should find several options (e.g. Snippet Designer, Snipper, etc.). I haven't used any of these so I can't attest to how good they may be but at least it's a start.
Hope this helps.
Resharper (not free) has it's own snippet system which is really great. I'm adding this answer because I was searching for something not realising I already had something installed (Resharper)
I heard that R#5.0 (still in beta) will support VS 2010. My question is
VS2010 == VS2008 + ReSharper ?
I know there are many improvements to VS2010, so I 'm not sure weather is it really worth purchasing the R#5.0 for VS2010?
Well, I haven't explored VS 2010 new refactoring features that much, but its my understanding that VS has some but definitely not all of resharpers features implemented (From MSDN):
Navigate To
You can use the Navigate
To feature to search for a symbol or
file in the source code.
Navigate To lets you find a specific
location in the solution or explore
elements in the solution. It helps you
pick a good set of matching results
from a query.
You can search for keywords that are
contained in a symbol by using Camel
casing and underscore characters to
divide the symbol into keywords.
For more information, see How to:
Search for Objects, Definitions, and
References (Symbols).
Generate From Usage
The Generate From
Usage feature lets you use classes and
members before you define them. You
can generate a stub for any undefined
class, constructor, method, property,
field, or enum that you want to use
but have not yet defined. You can
generate new types and members without
leaving your current location in code,
This minimizes interruption to your
workflow.
Generate From Usage supports
programming styles such as test-first
development.
IntelliSense Suggestion Mode
IntelliSense now provides two
alternatives for IntelliSense
statement completion, completion mode
and suggestion mode. Use suggestion
mode for situations where classes and
members are used before they are
defined.
In suggestion mode, when you type in
the editor and then commit the entry,
the text you typed is inserted into
the code. When you commit an entry in
completion mode, the editor shows the
entry that is highlighted on the
members list.
When an IntelliSense window is open,
you can press CTRL+ALT+SPACEBAR to
toggle between completion mode and
suggestion mode.
So I guess it would depend on which of Resharpers features you want to use. If you are satisfied with the above which is certainly great improvements, then you don't need Resharper.
On the performance question, well it might perform better because of tighter integration.
Personally the above leaves me still needing a lot of features like (just the ones i can think of right now - might be more):
There are as far as I can tell only about 6 refactorings, where resharper currently has more than 30
No import type completion, which i use ALL the time. One shortcut adds to references and adds import statement
No smart completion
Change namespace to follow navigation structure and update all references with one shortcut
Goto is more advanced in R# you can go to inheritors and bases,
file member, recent files and edits and theres the fast goto feature
Resharpers static analysis is far more comprehensive than what you get from VS
So what do you need? (I am definitely not giving up Resharper)
Peter,
Best person that can answer this question is yourself. What I suggest is you download it, learn it (and note I said learn it, not just play with it). Then decide. However, I'll warn you that it's quite addictive.
My question is VS2010 == VS2008 + ReSharper ?
Oh hell no. VS2010 has more features than VS2008, and some of those feature ideas were stolen from ReSharper, but vanilla VS2010 is still a long way behind VS2010 + ReSharper 5 or even VS2008 + ReSharper 5.
From a quick glance at my 31 Days of ReSharper blog posts (written back in the R# 2.5 days), here are just a few ReSharper features that are still not present in VS2010: (Please correct me if VS2010 does have any of these -- I haven't actually used it that much without ReSharper!)
Unused code highlighted in gray and with quick-fixes to delete the unused code for you (this is just one of many hints and warnings R# does that VS does not)
Visual indication of where you have hints, warnings, and errors in a source file (colored stripe next to the vertical scroll bar)
Integrated unit-test runner that's not locked down to only MS's test framework
Shared settings for code formatting, code templates, etc. -- check these settings into version control, and they'll be picked up automatically by other computers (no manual export/import)
Go To Type -- a pop-up window where you can enter a type name (or part of the name) and jump straight to the right source file
Navigate to derived types / overriding methods
Code Structure View -- view a list of members in your type, and drag/drop to reorder them in your source code
R# will suggest variable names for you
You can invoke an Intellisense dropdown that shows types from all namespaces (and then it adds the using for you)
It's eerily good at guessing what you meant when you tell it to fix an error for you
Remove unused braces and Invert If
Generate Code (I particularly like Generate Equals and GetHashCode, even though I use them very rarely)
Viral Rename (if you rename a type, it'll also suggest that you rename any variables that were named after the type)
And best of all, Safe Delete.
Safe Delete rocks.
And that's just the features that R# had in 2.5 when I wrote the 31 Days of ReSharper. They've added plenty of new features since (I just don't have a comprehensive list handy). A couple of my favorites are the background solution-wide analysis, which will tell you in nearly real-time if you have compiler errors anywhere in your solution, and Inspect > Value Origin, which is just wicked cool.
If your having to ask the question, my guess is that you're not using ReSharper to its full potential. Personally I find that R# writes most of my code for me and I feel like a noob using visual studio without it.
YES. unequivocably YES.
After migrating to Visual Studio 2010 we asked our development team if buying Resharper upgrades is worth the investment. The votes were unanimous: yes!
Btw: we use VS2010 Premium and the devteam has its own budget.
Why don't you try out the R# 5 betas and then you can decide if you're using enough of its features to justify purchasing it.
http://confluence.jetbrains.net/display/ReSharper/ReSharper+5.0+Nightly+Builds
ReSharper has been around long enough that developers might purchase the upgrade just out of habit! :)
I recall that when VS2008 was released, R# wasn't quite ready, and there was griping among the .NET community about it. "Must...have...ReSharper!". Heh. Jetbrains appear to be on top of it this time though.
Is there an easy way to produce MSDN-style documentation from the Visual Studio XML output?
I'm not patient enough to set up a good xslt for it because I know I'm not the first person to cross this bridge.
Also, I tried setting up sandcastle recently, but it really made my eyes cross. Either I was missing something important in the process or it is just way too involved.
I know somebody out there has a really nice dead-simple solution.
I'm reiterating here because I think my formatting made that paragraph non-inviting to read:
I gave sandcastle a try but had a really hard time getting it set up.
What I really have in mind is something much simpler.
That is, unless I just don't understand the sandcastle process. It seemed like an awful lot of extra baggage to me just to produce something nice for the testers to work with.
You're looking for Sandcastle
Project Page: Sandcastle Releases
Blog: Sandcastle Blog
NDoc Code Documentation Generator for .NET used to be the tool of choice, but support has all but stopped.
Have a look at Sandcastle, which does exactly that. It's also one of the more simpler solutions out there, and it's more or less the tool of choice, so in the long run, maybe we could help you to set up Sandcastle if you specify what issues you encountered during setup?
You should also use the Sandcastle Help File Builder. It provides you with a ndoc like GUI for generating help files so you don't have to do anything from a command prompt.
Welcome to the Sandcastle Help File Builder Project
I've just set up Sandcastle again. Try installing it (the May 2008 release) and search for SandcastleGui.exe or something similar (it's in the examples folder or so).
Click Add Assembly and add your Assembly or Assemblies, add any .xml Documentation files (the ones generated by the compiler if you enabled that option) and then Build.
It will take some time, but the result will be worth the effort. It will actually look up stuff from MSDN, so your resulting documentation will also have the Class Inheritance all the way down to System.Object with links to MSDN and stuff.
Sandcastle seems a bit complicated at first, especially when you want to use it in an automated build, but I am absolutely sure it will be worth the effort.
Also have a look at Sandcastle Help File Builder, this is a somewhat more advanced GUI for it.
Follow this simple 5 step article and you are pretty much done. As a bonus you can use H2Viewer to view Html Help 2.x files.
I use NDoc3