What's New in ReSharper 5
While improving its traditional code quality analysis functionality, ReSharper 5 is at the same time targeting a wider audience, thanks to its new, comprehensive approach to web development, and providing new features that are useful at solution/project level (in addition to class level) to benefit not just individual developers but whole teams.
ReSharper 5.1.x is the latest set of minor releases that features:
- Support for XAML 2009
- Performance and memory consumption improvements
- Numerous bug fixes
Read more about ReSharper 5.1 or ReSharper 5.1.1.
Compared to previous versions, ReSharper 5 has evolved in four major directions:
- Web Development. We have greatly extended the toolset available to ASP.NET developers when they work with markup files and web site infrastructure. ASP.NET MVC developers get a bonus in additional code inspections, syntax highlighting, navigation, and code completion for controllers and actions.
- Project Maintenance. ReSharper becomes a valuable assistant not only to individual developers but to teams working with large, complicated projects. It helps them view, change and maintain project structure.
- Support for Visual Studio 2010. ReSharper 5 provides support for the new Visual Studio version earlier than ever. Of course, Visual Studio 2005 and 2008 are supported, too.
- Code Analysis. This area incorporates several improvements, including
"plainly" implementing a substantial pack of new code inspections; the opportunity to get an overview of all code smells in solution; upgrading
foreachandforloops to LINQ queries; and letting you track how data values and method calls are passed through your code.
Other enhancements include extended IntelliSense, bookmarking, native NUnit support, and more.
Web Development
Users have long been asking for top-class support for ASP.NET and general markup. ReSharper 5 is the first version in a long time that doesn't only enhance performance on markup files but introduces a substantial pack of features aimed specifically at web developers working with ASP.NET and ASP.NET MVC.
ASP.NET
In ReSharper 5, support for ASP.NET is improved tenfold. New and enhanced features for ASP.NET include the following:
- Master page support in navigation and generation actions. Specifically, ReSharper generates page content based
on
ContentPlaceHolders from referenced master pages:
- File Structure tool window and Go to File Member navigation action for quick markup overview
in aspx pages:

- Go to Related Files action that navigates from aspx files to code-behind files, master pages,
user controls, etc.:

- Navigation, search and auto-import features for user controls (ascx files):
- Live, surround, and file templates for ASP.NET pages, including master pages:
ASP.NET MVC
ASP.NET MVC deserved our special attention. Dedicated features for ASP.NET MVC include:
- Syntax highlighting for ASP.NET MVC-specific method calls and parameters:
- Code completion that works for controller and action references in string literals:

- Navigation to and from actions or controllers:
- Creating new types and methods from usage in pages:
- Support for ASP.NET MVC 2 Areas:

Project Maintenance
ReSharper 5 helps individual developers better learn, visualize and optimize solutions that they're working on, and assists teams in enforcing custom coding conventions to eliminate code smells.
External Sources
A solution is not limited to sources included in projects, but also contains sources that were used to build libraries. Some companies publish parts of their sources using the Source Server feature of debug information files (PDB). This is the same technology that Microsoft uses to provide access to source code for parts of the .NET Framework. With ReSharper 5, sources stored that way can be accessed it as if they were a part of solution. When no sources are available, ReSharper does a decent job of reconstructing types' structure from metadata for developer convenience. Here's how it works:
- You select an external navigation option for a library symbol:

- ReSharper downloads PDB files from a source server:

- ReSharper displays the selected library symbol declaration as if it is defined in your solution:

Structural Search and Replace
Solutions are commonly flooded with various code smells that are hard to eliminate right away. ReSharper 5 helps you get rid of them in existing code, but more than that, it allows you to create custom inspections to remove poor coding artifacts on a recurring basis.
Specifically, ReSharper helps configure custom, sharable code patterns, search for them, replace them, include them in code analysis, and even use quick-fixes for regular code maintenance! Building patterns and enforcing good practices has never been this easy. Corporate and team policies, custom frameworks, favorite open source libraries and tools — structured patterns are able to cover them all.
- Defining a placeholder for a search pattern:
- Search and replace patterns listed in ReSharper Pattern Catalog:

- Highlighting code that matches a search pattern and replacing it with a replace pattern:

Project Refactorings and Dependencies View
ReSharper's refactoring family is extended to include several refactorings for modifying project structure. With ReSharper 5, you can:
- Move types between folders and projects.
- Synchronize namespaces to folder structure in any scope — as large as the whole solution.
- Safely delete obsolete subsystems without going type by type.
- Split a file with lots of types created from usages into their own dedicated files in one go.

We have also added a special project dependencies view to help track down excessive dependencies between projects and eliminate them. As an early ReSharper 5 user said, "I'm no longer afraid of restructuring my project. I just go and do it whenever I feel it's right."
Internationalization
Software localization and globalization have always been tough and at times unwanted tasks for developers. ReSharper 5 greatly simplifies working with resources by providing a full stack of features for resx files and resource usages in C# and VB.NET code, as well as in ASP.NET and XAML markup.
Dedicated features include Move string to resource, Find usages of resource and other navigation actions. Combined with refactoring support, inspections and fixes, you get a convenient localization environment.

Visual Studio 2010 and Tools
Visual Studio 2010
In contrast to previous ReSharper releases, ReSharper 5 provides early support for the new Visual Studio version.
As a result, ReSharper 5 works well with Visual Studio 2005, 2008, and Visual Studio 2010.
Special Visual Studio 2010 integration niceties include an enriched Visual Studio tooltip, and alpha-blended gray code that lets you see inspection results even in code that ReSharper highlights as unreachable:
C#4 and VB10
New language versions nowadays appear at a great speed, and ReSharper team works hard to support them right when you need them. ReSharper 5 provides support for C# 4 and VB10, as Visual Studio 2010 does itself. Variance, dynamic types, named arguments and optional parameters, embedded COM assemblies — all of these features are supported in the new ReSharper.

Code Analysis
Call Tracking
In previous ReSharper versions, attempting to track call sequences in code could end up with
lots of Find Results windows and lost context. With ReSharper 5, an entire call sequence is visualized in a
single window, in a straightforward fashion:
Value Tracking
Value Tracking gives you important information about data flow in your program. At any point in your source
code, select a variable, parameter, field or property and ask ReSharper to inspect it. You will then see how its
value flows through your program, back to its sources or straight to consumers:
Upgrade to LINQ
With C# 3.0 and LINQ, developers are able to write data-intensive code more easily by directly describing their intent to the compiler. However, years of imperative programming left us with tons of foreach-style code waiting to be upgraded. ReSharper 5 detects code that can be rewritten using the new LINQ syntax and offers to perform the conversion automatically.
- Original loop:
- A quick-fix to convert the loop to a LINQ expression:

- Conversion result:

Use IEnumerable Where Possible
With the power of LINQ, IEnumerable is more than enough to pass a collection of values. So why
restrict yourself with an API requiring you to pass old-school arrays, Lists and ArrayLists?
ReSharper will scan your code base to detect methods that can safely return and accept IEnumerable
instead of a more specific type. Of course, ReSharper will also take care of the conversion:
New and Improved Code Inspections
We have collected rich customer feedback and went through a list of common errors that developers make in code. Based on that, we have added lots of highly intelligent inspections. For example, ReSharper can help in proper documenting your API by highlighting errors in XML comments.
Solution-Wide Warnings and Suggestions
We have received a lot of positive feedback from our users regarding solution-wide error analysis that helps immediately see compilation errors in the whole solution.
In ReSharper 5, we took this technology to a new level by adding warnings and suggestions to the list. You can now
browse code smells that ReSharper finds across your solution and quickly improve the quality of your code:
Other Improvements
IntelliSense
ReSharper continues to bring first-rate IntelliSense experience, and the new version gives even more. We
have added automatic completion for enum members and boolean values, made automatic triggering smarter, and
greatly improved performance. Completion for all-lower text with CamelHumps — makes cocopro match CodeCompletionProvider. Completion for unresolved symbols in local scope is another new ReSharper
IntelliSense feature:
Bookmarks
This is a simple yet powerful feature: you can drop a numbered marker with a single shortcut, and jump back at any
time
with another shortcut. Up to 10 numbered bookmarks, unlimited unnumbered bookmarks, full list of
bookmarked positions in a single pop-up window — all to speed up navigation between code spots:
Native NUnit Support
ReSharper 5 introduces a completely new approach to running NUnit tests. Our engine is now based on native NUnit code, which means 100% compatibility with the latest released version of NUnit and full support of its recent unit testing features.
XML Formatting
XML data is an important part of modern applications and it should be kept in order. The new version of ReSharper is supplied with a configurable formatter for XML files.
Find out how ReSharper 5 compares to ReSharper 4.5, and download ReSharper 5.
