Author Archive

Optimizing Assembly References with ReSharper 6.1

Tuesday, January 3rd, 2012

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6:


One of the prominent new features in ReSharper 6.1 is the ability to easily manage your existing assembly references, browse usages of referenced assemblies, and remove unused references.

In fact, this is not a single feature but three features. Each of them is outlined below:

  • Optimize References. This is the main feature for analyzing referenced assemblies. It can be invoked on any single project from the project’s own context menu or from the context menu of the References node in Solution Explorer:

    The Optimize References tool window displays assembly references that are both unused and used in the current project, and shows how exactly references are used. The feature does not require your project to be compiled, which means you can invoke it even if your project is currently broken.

    One of the best things about this feature is that it allows you to explore usages of a specific referenced assembly, namespace or type; filter them by kind, group them and navigate from them directly to your source code. The screenshot below illustrates exactly why this project references EasyHttp.dll, which types from that assembly are used and where:

    Different icons mean different kinds of usages like read, write, attribute, or invocation usages — the same usage filtering functionality that is used in all other ReSharper search features based on Find Results window. However, one kind of usages is unique for Optimize References: it’s called “related usages” and indicates implicit (non-direct) assembly reference usages required for the compiler.
    In the simplest case, related usages are caused by a type’s hierarchy. That is, if you use a certain type, you have to reference all assemblies containing that type’s supertypes. Unfortunately, this is just one example along with many others which are much more complicated!
    In addition to exploring assembly usages, you can delete unused assembly references directly from this tool window — the toolbar contains two buttons, Remove all unused references and Remove selected references:

    Note that this feature also deletes all redundant C#, VB.NET or XAML namespace import directives which reference namespaces from the assemblies being removed.
  • Remove Unused References. This refactoring quickly detects unused assembly references without displaying their usages. Since it works faster than Optimize References, it is very useful if you don’t want to a full-fledged usage analysis and you’re just looking for a quick cleanup of your project references.

    Clicking Analyze Used References… button in this dialog box will open the Optimize References tool window for a thorough analysis of reference usage.
  • Safe Delete Assembly Reference. This refactoring either silently removes selected assembly references or opens a confirmation window indicating that some of the selected references are used (and shows how they are used.) The refactoring is available on pressing Alt+Del on an assembly reference (or references) selected in the Solution Explorer, or via Refactor This shortcut menu.

These 3 features introduced in ReSharper 6.1 will definitely help you maintain your solution and get rid of redundant dependencies. By the way, keep in mind that if you want to find out which code is referenced in a given scope other than a project (for example, in a folder or in a method), you can use ReSharper’s Find Symbols External To Scope feature that has been recently made available as the Referenced Code option via Navigate To shortcut menu.


The original post is authored by Kirill Skrygan (@kskrygan on twitter), ReSharper developer and the the author of the Optimize Assembly References feature set.

ReSharper 6.1.1 Early Access

Friday, December 30th, 2011

Do you like ReSharper 6.1? Judging by the feedback that keeps arriving via multiple channels, most users are happy with performance improvements and extended functionality.

However, could there be a release of an application as complex as ReSharper without bugs? This is very unlikely, and we do know that 6.1 RTM does have certain issues that affect a part of its audience.

With that in mind, we’re planning to deliver another minor update early next year that would exclusively focus on fixing issues discovered with 6.1 that don’t imply any substantial architectural changes. For the most part, the issues have to do with the new settings engine not always persisting changes.

Meanwhile, we felt it would be fair to deliver a build that would incorporate fixes implemented this far before the team goes on holidays until Jan 10. That said, everyone who is affected by this set of issues with 6.1 is welcome to download the initial build from ReSharper 6.1.1 Early Access Program. Expect further early builds mid January.

OK we’re done for the year. See you around in 2012!

New dotPeek Build: Base Types and Inheritors in Assembly Explorer

Thursday, December 29th, 2011

We have today released a new early build of dotPeek, our lovely .NET decompiler and assembly browser.

One thing about this new build that’s worth a mention is that from now on, the Assembly Explorer contains nodes representing base types and inheritors of the current type — in addition to the actual list of members:

We hope that would be a handy addition for people with Reflector background. Of course, you can still use ReSharper-based navigation features such as Go to Base, Go to Inheritor, and Type Hierarchy to explore inheritance chains from symbol occurrences in the source code view area.

Other than that, the new build is mostly filled with bug fixes in decompiler core, and a couple of niceties such as support for non-standard DPI settings in the UI, and support for Math.E and Math.Pi, which for example enables the decompiler to output 2.0*Math.PI/3.0 instead of 2.0943951023931966.

The list of all fixes in the build is available here, and as usual, you can get the new dotPeek build from the Early Access Program home page.

ReSharper 6.1: The Finish Line

Tuesday, December 13th, 2011

A couple of days ago, we have started to release ReSharper 6.1 nightly builds in production mode, with build 30 being the first one of the new breed.

What sets production builds apart from regular development builds is that exceptions are suppressed, meaning no more wild life in the right corner of the status bar, and performance is slightly better due to lower count of checks, asserts and whatnot. Basically, production mode builds is what you get when we deliver betas, release candidates, and final release builds.

What it all means for you is that if you’re generally reluctant to trying nightly builds due to the annoyance of exception reporting and general mistrust, this might be the right moment for you to test-drive ReSharper 6.1 before we release it — even more so considering that we’re not planning any beta releases prior to 6.1 RTM.

Having said that, please grab a fresh nightly build and try it out. Here’s the list of issues that separate us from releasing 6.1. If you think there are any more show-stopper level issues, please be quick to ping us here in comments or by creating a bug report. Thank you!

dotPeek is Back with New Early Build

Thursday, December 8th, 2011

After several months of no-show, we’re relieved to provide a new early build of dotPeek — our free .NET decompiler and assembly browser.

We apologize for the considerable delay updating the tool, and we expect that as ReSharper 6.1 development is mostly coming to an end, we can now focus more on pre-release polishing of dotPeek.

Here’s the list of prominent changes in the new dotPeek early build (No. 7603)

  • Opening .dll files by double-clicking in Windows Explorer. dotPeek can now automatically register as an application that handles files with the .dll extension. (DOTP-151) To switch Windows Explorer integration on, select Tools > Options, and click Integrate with Windows Explorer under Environment | General.
  • Resource decompilation. dotPeek can now open assembly resources, including images and XML-based resources (for example, .resx or .dtd files), internally or by passing them to an external application.
  • Opening libraries in a single dotPeek instance. (DOTP-2615) If you’re used to browsing assemblies in a file manager and opening them in a decompiler from there, there’s no more annoyance caused by initializing multiple copies of dotPeek.
  • XML doc comments can be shown in decompiled code if the corresponding XML documentation file is available. (DOTP-1208) For instance, that means additional convenience when exploring .NET Framework libraries.
  • Properties window that provides basic information about assemblies and references selected in the Assembly Explorer. (DOTP-481)
  • Reference Hierarchy tool window. Based on ReSharper’s Type Hierarchy feature that is now extensible, this new tool window shows which references the current assembly has, allowing you to track down all its dependencies, and additionally showing recursive dependencies with a glyph to the right of a reference entry. If you click Referencing projects in the tool window’s toolbar, you can see which of the assemblies in your current assembly list reference the current selected assembly.
  • Drag-n-drop assemblies: You can now drag assemblies (or selections of assemblies) from Windows Explorer, and drop them into dotPeek, which adds them to dotPeek’s Assembly Explorer.
  • New command-line options including keys to switch Windows Explorer integration on/off, hide splash screen, and always open every new assembly in a new instance.
  • Other improvements including a toolbar with basic commands, configurable font in the source code view area, and a new ReSharper-like Options dialog box (work in progress). Also, dotPeek window position and state is now preserved between application launches.

For die-hard fans, here’s a selection of issues resolved for this build.

Please download the new build and try it out. As usual, you’re encouraged to report any issues you’re facing to dotPeek bug tracker.

Important: Change of Venue for JetBrains Event in London Today

Friday, November 18th, 2011

If you’re planning to attend the JetBrians Magical Mouseless Continuous England Group Tour event today in London, please be aware that the location has changed.

The new location is 150 Minories, London EC3N 1LS

It’s only 5 minutes walk from Aldgate Tube Station, and 10 minutes walk from the old location on 45 Beech Street.

We sincerely apologize for the short notice on venue location change, and we’re looking forward to seeing you at the event!

Oredev License Raffle Winners!

Thursday, November 17th, 2011

We’ve recently got home from Oredev after having a great time talking with developers from all around Northern Europe, drawing pictures and shaping the geek fashion. This is one terrific conference and we’ll do our best to get there next year as well.

We have also invited attendees to take part in a license raffle at the booth, and we are now happy to announce the 10 lucky winners. Here they are:

  • Magnus Kivi: IntelliJ IDEA Ultimate license
  • Robert Broden: IntelliJ IDEA Ultimate license
  • Alexander Tarnowski: IntelliJ IDEA Ultimate license
  • Henrik Andersson: dotTrace Performance + Memory licenses
  • Olle Jacobsen: dotTrace Performance + Memory licenses
  • Erik Agren: dotTrace Performance + Memory licenses
  • Shmuel Gershon: dotTrace Performance + Memory licenses
  • Jens Ribbholm: ReSharper license
  • Tommy Savela: ReSharper license
  • Jukka Puranen: RubyMine license

Congratulations to those lucky devs who should receive their license certificates in a short while. Develop (and profile) with pleasure!

ReSharper 6.1 EAP Opens: Much More than a Bugfix Release

Friday, November 4th, 2011

It took longer than expected but here we are, opening the ReSharper 6.1 Early Access Program that’s meant to eliminate any pain points you might be having with ReSharper 6.0, via performance and bug fixes. However, ReSharper 6.1 also provides a lot of new functionality that all 6.0 users will be getting as a free upgrade.

UPDATE! ReSharper 6.1 is officially released, Early Access Program is over.

Here are some of the best reasons why you should totally try ReSharper 6.1:

  • Performance fixes: Has ReSharper 6.0 been harsh on you performance-wise? Has it been processing source files longer than expected? 6.1 shouldn’t. Here’s the list of performance issues that have been fixed.
  • Bug fixes. The list of bugs fixed for 6.1 is here for you, highlighted by massive efforts to improve unit testing, structural search and replace, VB.NET code resolve, as well as code completion and typing assistance in ASP.NET MVC 3 (Razor).
  • New settings engine. Settings have been revamped extensively, with extra emphasis on sharing and managing them. We have made many more settings accessible and sharable, and introduced new granular settings — for example, those for IntelliSense behavior for different languages. Settings are now layered meaning that you can define global, per-solution, per-team or individual settings. You can now export and import all or selected settings to/from a single file — for this and other settings management operations, use the new Manage button under ReSharper > Options.

  • Here’s a rough list of settings-related problems solved for 6.1. Mind you, nothing is set in stone yet. We’re still making changes to this subsystem, and we’ll do that based on feedback from you and your team.

  • Support for Async CTP. You have asked for it: Not only does ReSharper 6.1 support async and await keywords — both in C# and VB.NET — but it also provides a set of code inspections and quick-fixes: for example, it sees dead code when an asynchronous method lacks await operators, and warns when you’re using a wrong return type in an asynchronous method.
  • Optimize Assembly References. This has been requested for even longer, and here it is: ReSharper 6.1 detects any references that are not effectively used in your project, and provides a nicely built UI to get rid of all or some of them. Project maintenance just got easier with ReSharper!
  • Experimental support for the initial Visual Studio 11 Developer Preview. We have adapted ReSharper to run under Dev11, and it does so fairly well with existing code. Manual setup is required here, and we’ll follow up with a post containing VS11 install guidelines. However, please understand that this is only initial, experimental support for existing types of projects with a specific Developer Preview build (the one made available on September 16, 2011.) We can’t guarantee any consistency of your experience with ReSharper 6.1 EAP (or even the future release of 6.1) under VS11 Developer Preview. Needless to say, no support for developing Metro style applications is there. Official support for VS11 will not be made available any earlier than the next major ReSharper release.
  • ReSharper SDK. This is something that should simplify ReSharper plug-in development dramatically. Delivered as an MSI or ZIP file, the SDK provides a full set of ReSharper assemblies, including test infrastructure assemblies required to test ReSharper plug-ins, target files, and (in the MSI version) Visual Studio templates for creating different kinds of plug-in projects.
  • A great load of improvements relevant to web developers. This includes new quick-fixes and refactorings for CSS; Structural Search and Replace for HTML and ASP.NET; Move Helper refactoring, internationalization and Call Tracking for ASP.NET MVC 3; generation of event subscriptions in ASP.NET; a UI to configure path mappings for web site deployment; and many more improvements, some major, others not so much, that we’ll be expanding upon in a separate blog post.
  • New code inspections and quick-fixes for C# and VB.NET. Aside from the set of Async CTP related inspections, ReSharper 6.1 has also improved in terms of control flow redundancy analysis (for instance, detecting more cases of redundant return statements); it also detects access to disposed closure and covariant array conversions, and provides corresponding quick-fixes where available.
  • XAML support improvements including code completion enhanced in certain scenarios, batch generation of event subscriptions, improved attached property awareness in error highlighting and code completion, as well as an option to create a namespace alias from usage:

We have also added a new refactoring to convert iterators to methods; internationalization for VB.NET projects; navigation and search updates including Quick Search in Type Hierarchy window, export to HTML and XML from all tool windows supporting import/export functionality; and more. There are simply too much changes, subtle and prominent, to summarize in a single blog post without turning it into an encyclopedia.

For die-hard fans, here’s the list of all YouTrack issues fixed for 6.1.

Go forward and download ReSharper 6.1 EAP builds ReSharper 6.1 official release, and expect more blog posts covering 6.1 functionality in greater detail to come up soon.

dotCover Roadmap, Subscription Renewals, and 1.2 EAP

Friday, September 30th, 2011

Our salute to everyone covering their .NET code!

We have several dotCover-related news items this time: what’s new in dotCover 1.2; how dotCover is going to evolve mid-term, and how to make sure you’re eligible for subsequent dotCover versions.

dotCover 1.2 EAP

First of all, we have recently started Early Access Program for dotCover 1.2. This is a maintenance release that could be of interest to those of you who are using dotCover with massive solutions and experiencing performance and memory issues.

  • Improved performance of report generation and coverage highlighting. This doesn’t have anything to do with creating a snapshot but rather with its further processing. We have clocked moderate performance improvements in generating reports for ReSharper solution. We’d be happy to know whether this also gets things smoother for you if you’re using dotCover on large solutions.
  • Reduced HTML report size: both in Visual Studio and in the console runner. Specifically, we have managed to reduce the size of ReSharper report 1.5 times, making it 10 Mb lighter.
  • Reduced memory consumption during snapshot merge. This is based on internal feedback but may very well make life easier for everyone who has ever encountered OutOfMemory exceptions on merging snapshots.
  • Miscellaneous bug fixes and minor improvements: see this YouTrack query for complete release notes.

One more thing about this EAP is that it’s prepared to support ReSharper 6.1 that we’ll hopefully make available for early access in two weeks’ time.

dotCover Subscription Renewal Licenses Available

It’s now been a year since dotCover 1.0 was released, and since a dotCover license includes one year of free upgrades, the free upgrade period has just expired for some dotCover users. If you’re using a recent dotCover version and there’s a “license not acceptable” message in your dotCover License Information dialog box, that means you’re no longer eligible for free upgrades:

If you would like to be able to upgrade to forthcoming versions of dotCover (see below for some of the reasons why you’d love to) for another year, you should purchase a 1-year upgrade subscription renewal license, which is worth (roughly) 50% of the current initial license price — that is, $75 or equivalent for commercial license upgrade subscription renewal, and $39 or equivalent for personal license upgrade subscription renewal.

To renew your upgrade subscription, refer to one of the two e-mail reminders that we’re sending out when a subscription is going to end soon, and as soon as it has ended. If you haven’t received any reminder e-mails, please go to dotCover buy page and use the new “Upgrade subscription renewal” license option in either “Commercial license” or “Personal license” column:

For detailed upgrade subscription terms, please proceed to this page.

dotCover Roadmap

You will hardly want to purchase any upgrade subscriptions without knowing in which directions the product is going to evolve. Here’s a quick roadmap highlighting features that we’re going to make available in new releases during the year ahead:

  • Running and measuring coverage of unit tests without ReSharper. Current versions of dotCover rely heavily on ReSharper unit test runner (and its framework-specific plug-ins) for running and measuring coverage of unit tests. You just can’t execute unit test coverage without integrating dotCover into ReSharper. This isn’t a problem for ReSharper users but there’s no way to reach a wider audience until dotCover provides its own test runner — and it will do so! Unit test runner, currently ReSharper’s exclusive asset, will soon be available in both ReSharper and dotCover, making unit test coverage possible without ReSharper’s assistance.
  • More built-in navigation. ReSharper provides more than unit test runner to dotCover: certain navigation actions in dotCover are only available if ReSharper is installed in Visual Studio. For example, you can’t currently navigate from Coverage Results Browser to Visual Studio text editor using the keyboard: this is only possible from the Coverage tab in ReSharper’s Unit Test Sessions. Inconveniences like this will also be removed as dotCover gains more intelligence from ReSharper.
  • Priority coverage suggestions. We’ll train dotCover to gather metrics such as cyclomatic complexity in order to suggest which parts of your code base should be covered with unit tests in the first place — thus evolving from formal coverage statistics to a more insightful and task-efficient approach.
  • Coverage filtering by attributes. dotCover will enable you to create attribute filters. It will skip measuring coverage of code marked with attributes you’re listed. This will help prevent wasting time on measuring coverage of auto-generated code and any other kinds of code that you don’t want dotCover to process. In configuring filters, you’ll be able to use both common attributes like GeneratedCode or MSTest’s ExcludeFromCodeCoverageAttribute, and any other attributes used on assembly, method, or class level.

This is not all features that we’d like to implement in near future — rather, those that we’re confident in being able to bring to life. On the other hand, we don’t have an ultimate list of expected changes, and as usual, you can throw your suggestions via dotCover issue tracker or discussion forum, and we’ll take your input into account as we schedule our development process.

ReSharper 6 RC2; EAPs for dotCover, dotTrace Performance

Tuesday, June 28th, 2011

We have a new ReSharper build for you available: ReSharper 6.0 Release Candidate 2.

RC2 removes a few more outstanding cases of good-code-red, ensures that ReSharper takes the Suppress warnings project property into account, fixes a pack of issues related to the Find Code Issues window and solution-wide analysis.

In other news, we have opened Early Access Programs for dotCover 1.1.1 and dotTrace 4.5.1 Performance — new minor versions of the code coverage tool and the profiler tailored specifically to support ReSharper 6. We’ve received a lot of complaints on ReSharper 6 not being able to integrate with dotCover and dotTrace Performance, and these EAPs will hopefully take this pain away.