dotTrace 5.0 Performance Early Access Program

January 24th, 2012 by Hadi Hariri

As some of you may have noticed, we have recently opened the EAP for dotTrace 5.0 Performance. It was a very quiet launch for a number of reasons, but now here we are talking about the new exciting version of the .NET performance profiling tool.

There’s a ton of new features in this release as outlined below and some of the major features we’ll get back to in future posts, covering them in full detail. For now, download dotTrace 5.0 Performance EAP, and read further to learn what you’re going to get with it.

Remote profiling enhancements

Remote profiling with dotTrace 5.0 PerformanceOne of dotTrace Performance benefits is the ability to preform remote profiling of applications. This comes in very useful when instance you are trying to diagnose and issue on a machine that is in production. In dotTrace 5.0 Performance, we have enhanced this behavior to allow:

  • Running the profiling agent as a regular service or ASP.NET Web Service.
  • Remote profiling over HTTP. This effectively removes some of the common barriers encountered when trying to do remote profiling such as firewalls or VPNs.
  • Less administrative permissions making it easier to use in more restricted environments.

Attach to a running process

A great new feature in dotTrace 5.0 Performance is the ability to attach the profiler to an existing process and run performance analysis on it. Once sufficient information has been collected, the profiler can then be detached. This allows us to open up new usage scenarios like taking a snapshot of an application that needs to be run for hours (or days) before it starts to display any performance issues.

dotTrace Performance can now attach to a running process

Profiling API re-design

In dotTrace 4.5.1 Performance, we introduced a very early version of the profiling API which allows you to incorporate profiling capabilities inside your application. It was a rough-cut version and had one minor glitch: you could not detach the profiler once attached. This problem has now been solved as mentioned above, and the API has been overhauled to provide a much richer development experience.

Command line support

Version 5 also introduces support for running dotTrace Performance from the command line, including:

  • A configuration helper for command line execution.
  • Ability to integrate performance profiling into the Continuous Integration process (using TeamCity for example) via MSBuild or NAnt tasks.

dotPeek integration

If you are still not familiar with dotPeek, it is a free .NET decompiler tool which we opened the EAP several months ago. One of the core ideas of dotPeek is to offer integration with our other productivity tools, such as ReSharper, whereby you can decompile any assembly for which you do not have the sources, directly from within Visual Studio. We now offer the same experience with dotTrace 5.0 Performance (we have actually posted a preview of it several months ago.) While profiling an application, if you need to dig further into the code and you do not have the PDB’s, dotTrace Performance will decompile it for you in-place and present decompiled code in the source preview area.

Decompiling .NET code within dotTrace Performance

Enhancements and additions for supported frameworks

This version will also provide support for CLR 4.5 as well as Windows 8. In addition to the new frameworks, dotTrace 5.0 Performance also provides side-by-side profiling of CLR 1/2 and CLR 4.0/4.5 frameworks.

Compatibility with TypeMock Isolator

In collaboration with our friends at TypeMock, we have made dotTrace Performance work seamlessly along with TypeMock Isolator. This allows you to easily profile your unit tests even when using TypeMock as a mocking framework. It also means that dotTrace Performance can now work in what’s called transparent mode, stepping back and allowing other engines to interleave between dotTrace and the target of the performance profile.

Improvements in Plain List View

Among the improvements is the ability to filter in-place, system functions in the Plain List View as well as group functions by assemblies:

Improved Plain List View

Other features and improvements

dotTrace 5.0 Performance is packed with a ton of smaller features, bug fixes and performance improvements, including:

  • Lower memory footprint during performance profiling.
  • Support for IIS Express from within or outside of Visual Studio.
  • Improvements on the UI for Adjust Time functionality, allowing control of non-user-defined functions.
  • Up to 20 times performance improvement on plain list construction for larger snapshots.
  • Threads with message pumping loop are now highlighted.
  • Close to 40 bug fixes, including some important ones affecting callstacks.

Get your EAP build!

You can start playing with dotTrace 5.0 Performance by downloading the latest nightly build from the Early Access Program Page today!

Importing / Exporting Templates and Patterns in ReSharper 6.1

January 23rd, 2012 by Hadi Hariri

 

One of the changes introduced with the new settings in ReSharper 6.1 is how importing and exporting of templates and custom patterns are done (Custom Patterns were previously known as Structural Search and Replace).  As part of the unification of settings, Templates and Patterns now fall under the same modus-operandi when it comes to importing and exporting as other settings do. This is very similar to how our IDEA based IDE’s such as IntelliJ, WebStorm et al. work. However, certain legacy functionality is also available depending on what needs to be done.

The de-facto choice

Be it Templates or Patterns, when you want to import or export them, the recommended approach is to use the Manage Options dialog

 

SNAGHTMLa44bc04

 

To export, we merely select Export to File. ReSharper prompts us with a dialog box of what we would like to export:

 

SNAGHTMLa471579

 

At this point we can select whether we want Live Templates, Patterns (StructuralSearch*) or both. It is important to note that if you do not have any user defined templates and/or patterns, then these options are not available, i.e., you would not see the LiveTemplates / StructuralSearch checkboxes.

 

The exported file format is only compatible with ReSharper 6.1 and higher (.DotSettings file).

 

Importing

When it comes to importing templates and patterns, if these are in .DotSettings format, then it is merely about adding another layer. We select the file to import, and are prompted on what settings we’d like imported:

 

SNAGHTMLa62f7ad

 

The benefit of this approach is not only that it keeps all settings centralized, but it also allows us to mount and un-mount related templates.

 

* StructuralSearch comes from the old name giving to Custom Patterns which was Structural Search and Replace

 

Exporting Individual Templates

One option that is currently not available using the Manage Options dialog when dealing with the export of templates is to selectively choose which ones we’d like exported. If we want to only export specific templates, we need to use the Template Explorer (previously named Live Templates)

SNAGHTMLa66c44e

 

We can then select individual templates and choose the Export button. This is basically the old behavior prior to ReSharper 6.1. The difference however is that the file exported is in the new .DotSettings format. In this regard, there is no difference between this approach and the previous Manage Options one.

 

Dealing with legacy templates and patterns formats

The Templates Explorer window also has an option to import Templates

 

image

 

Although this allows the newer DotSettings file format, we usually should only use this when trying to import legacy templates (from version 6.0 and lower).

 

When it comes to Patterns, when trying to import older ones, we can use the Import from R# v6.0- button on the Custom Patterns options page

 

image

 

 

Summary

With the new settings we’ve hopefully made sharing of Patterns and Templates a little easier. There are still improvements to make but any/all feedback or changes you’d like to see are welcome. Please log them in our issue tracker so that they can be managed better.

Per Project Settings or How to have different naming styles for my test project

January 18th, 2012 by Hadi Hariri

 

One nitpick that I myself and many have had with ReSharper is not being able to have different naming styles for types based on different projects. In my code I normally name classes using CamelCase

 

image

 

and in my test project I use all_lowercase

 

image

 

Unless you add all_lowercase as a valid naming style, you’ll always end up with those squiggly lines under all your tests. And let’s admit it, it’s not a big deal but it’s annoying. #FirstWorldProblem

 

Say hello to my little layer

With ReSharper 6.1 we introduced the concepts of layers, which open up many new possibilities, including sharing settings on DropBox and or setting company wide standards. What you might not know is that it allows Per Project Settings too! No big deal if you didn’t know, since we currently do not support it via the User Interface so it would be hard to figure it out. However it’s pretty simple to do and I’m going to show you how.

 

Our goal here is to allow all_lowercase settings for classes in our test project (Tests) and not permit the same in other projects (Project). This is the sample project layout we’re going to be working with

 

image

To make this happen, we need to create specific settings for the Tests project and allow the possibility of classes being all_lowercase. That is, the Tests project needs its own DotSettings file.

 

Since there’s no specific button or option to add Per Project settings in the UI, this is where we need to kind of use a workaround. We need to have a Settings file for the project and then edit the options and save it to this file. There are many ways to create this new settings files. We can copy the solution one and rename it, we can export the current settings, we can mount a new layer and have ReSharper create it for us, etc.

We’re going to use this last method. Why? Because since ReSharper mounts it when it creates the file, it will allow us to edit the settings too.

 

 

1. With the Solution open, click on Manage Options under ReSharper

 

2. Under This Computer, click on the Add Layer icon (on the right) and select Create Settings File

image

 

 

3. Save the file to the Tests project folder, in our case that would be under SolutionDir\Tests and name it (and here’s the important part) Tests.csproj.DotSettings. That is, it should be named with the ProjectName, followed by csproj or vbproj based on the type of project and with the extension DotSettings.

 

4. Now that we have the settings file mounted, we need to change the required settings, which in our case is to allow classes to have all_lowercase (this obviously works for other settings too). As such, double-click the recently mounted file or right click and click on Edit

 

image

 

5. The Options dialog comes up. We want to edit the naming styles

 

image

 

Modify any other settings you wish at this point and once done, hit Save on the Options dialog.

 

image

 

At this point, we can remove the mounted settings as its not required for it to actually work. We can also leave it in order to easily access the settings for the project in the future. If you do leave it, make sure you uncheck the checkbox so that settings are not applied to the entire solution.

 

[Recommendation: If you decide to leave the settings mounted, mount these under Solution Shared or Solution Personal as opposed to This Computer so that you don’t end up with a long list of different settings files]

 

 

As soon as we hit Save, the new settings automatically are picked up by ReSharper and take effect. We can now see that the naming style no longer appears incorrect under the Tests project

 

image

 

and if we try and use the same style in the actual Project we do get the warning

 

image

 

The UI will come

Once you do this once, you can pretty much copy the same file over to your different projects and rename it to match the project name. In one of the next versions of ReSharper we will provide a more intuitive UI (or should we say we’ll provide an actual UI) for this. For now however, I think this minor hack will make a few people happy!

Introducing ReSharper 6.1 SDK

January 18th, 2012 by Dmitri Nesteruk

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. Those cover support for JavaScript (including unit testing with QUnit), CSS, ASP.NET MVC 3 Razor, and Async CTP; bundled decompiler; explanations on ReSharper inspections; fine-tuning file headers; ReSharper settings revised in 6.1 (and their company-wide usage); recent improvements in IntelliSense options, and optimizing assembly references


Though every new release of ReSharper comes with extra features and functionality, there are always things that our users want that don’t come out of the box. This includes things like, for example, support for various unit test frameworks as well as various bits of functionality that are domain-specific or related to particular challenges a user is facing.

Luckily, ReSharper has always shipped with an Open API which provided the opportunity to write plug-ins — extensions to the core ReSharper mechanisms that would be provided in separate files and integrated into ReSharper at start-up. While the opportunity was always there, and has resulted in a number of plug-ins being written, there’s never been any framework that would simplify the task for plug-in developers. Until now.

With the release of ReSharper 6.1, we have also introduced the ReSharper SDK — a separate framework that has been designed to make plug-in development easier. The SDK includes the following:

  • ReSharper assemblies, including PDBs and documentation XML files. These files include not just the core ReSharper assemblies, but also the unit test framework, which lets you write unit tests for your plug-in.
  • MSBuild target files, which make referencing the ReSharper assemblies a lot easier.
  • Project and item templates for VS2010, which make getting started with plug-in development a breeze.

Two packages are provided with the SDK: the MSI installer, which comes with all of the above, as well as a ZIP package, which contains only the assemblies and target files, and is provided to help build and test plug-ins in Continuous Integration systems such as TeamCity. Both packages contain introductory documentation to help you get started, with the bulk of documents related to plug-in development available online. These documents contain a variety of topics such as how to port your plug-in to use the SDK, develop support for a new language, or deploy the plug-in. The documents are being actively developed, and you’re welcome to comment on them should things start getting unclear.

The SDK packages are available on the ReSharper Downloads Page under Related Downloads. The following JetBrains TV video provides a comprehensive overview of the various SDK features including plug-in development, testing and configuration under TeamCity.

Optimizing Assembly References with ReSharper 6.1

January 3rd, 2012 by Jura Gorohovsky

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

December 30th, 2011 by Jura Gorohovsky

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

December 29th, 2011 by Jura Gorohovsky

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: Improvements in IntelliSense Options

December 27th, 2011 by Hadi Hariri

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:



ReSharper 6.1 introduces more fine-grained control over Intellisense.

image

As shown in the screenshot, in addition to the two older options (enhancing Visual Studio’s Intellisense with ReSharper or leaving as is) we can now select which technologies to apply Intellisense to. It is important to note that by de-selecting a technology, we do not switch off Visual Studio Intellisense for that technology, but only eliminate ReSharper’s enhancements of it.

Defining Autopopup behavior

The way Intellisense works inside Visual Studio, including ReSharper’s, is that matching elements appear as you type, allowing you to select the option by hitting Tab or Enter

This default behavior can be very productive, but it can also prove somewhat annoying, specially when we’re doing things like Test Driven Development or any kind of Create from usage scenario. For instance, we are trying to write a class or method that does not exist. We write it out and hit Enter, Intellisense completes it with the nearest match

In order to avoid these situations, we have added a new feature to ReSharper 6.1 which allows us to control not only where we want Intellisense to appear, but also how. That is, in addition to selecting the technology such as HTML, C# or XAML, we can now fine-tune Intellisense in each of these. Under ReSharper | Options | Intellisense | Autopopup we have the following screen

SNAGHTML82e9576[4]

Much like the Code Inspections, it is divided into different tabs based on the technology and an All tab that displays all entries. If we look through the list, we can see that under C#, we have several options, one of them being
SNAGHTML8326fdc

By default, all entries have the value “Display and preselect” which results in the behavior shown in the previous video. We can however change this with two other options

  • Do not display which will completely disable Intellisense
  • Display but do not preselect which will display matching values but will not preselect it.

This latter option is what we need in our case. We’d like to know of existing elements, but not necessarily have them completed when hitting Enter or Tab, etc. The video below displays this new behavior

Same as we have done with the After ‘new’, we can do with many others.We have tried to think of the most common scenarios where one would like to control this behavior. Please let us know if you feel something is missing. Hopefully however, this makes working with Intellisense productive and often less intrusive.

ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance Released

December 20th, 2011 by Hadi Hariri

Christmas is only a few days away and we’ve decided to celebrate it a little earlier by releasing not one, but all three of our main .NET tools: ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance.

ReSharper 6.1

As covered in previous posts, this release of ReSharper is much more than a few bug fixes.

Settings

In ReSharper 6.0 we laid the foundations for what would be the new settings management engine. This was quite a substantial change, both from an architectural point of view as well as functional. Unfortunately due to that pesky little annoyance called time, we did not manage to finish it for the 6.0 release. We have now though and ReSharper 6.1 introduces a wealth of new possibilities for sharing settings across solutions, teams, machines and even company-wide policies. And we’re still not done with settings, so keep your feedback coming for further releases.

image

Performance improvements

For every single release of ReSharper, we invest a large amount of time in performance improvements. This often isn’t an easy task since new releases also include new functionality. In 6.0 we had some serious performance issues with certain types of web projects. This has now thankfully been resolved in 6.1 and we’ve made 6.1 faster in many areas. Numbers are impressive: we have fixed 140 performance problems for 6.1.

Async and Visual Studio 11 support

Async support in C# is still in CTP stage. Visual Studio 11 is in early developer preview. Trying to support technology that is not entirely finished proves not only challenging but also risky. Any major changes could deem most of the work we’ve performed as obsolete. However, we know that you, our users, play with the early bits and miss ReSharper.

image

That’s why in 6.1 we provide support for Async features in C# and VB.NET, as well as initial experimental support for Visual Studio 11. Support for Metro style applications is not yet included, and in order to install ReSharper into VS11 Developer Preview, you have to use a separate .vsix installer available at ReSharper downloads.

Optimizing assembly references

Many users rely on ReSharper in streamlining their project maintenance tasks, and this new feature is a nice addition to the existing project-level toolset. In any project in your solution, ReSharper 6.1 detects assembly references that are not effectively used, and helps remove some or all of them.

image

SDK

During 6.0 development we invested heavily in trying to provide a better API for extending ReSharper. 6.1 also sees the birth of this effort. Along with an improved API, we also now provide a testing framework, Visual Studio templates for creating plug-ins, samples, as well as online documentation. ReSharper 6.1 SDK is available for download as a .msi or .zip package.

image

More awesome features

Here are a few more great features also added:

  • Structural Search and Replace for HTML and ASP.NET. You can now use Custom Patterns to refactor both HTML and ASP.NET markup.
  • Call tracking for ASP.NET MVC. Same call tracking features, extended to ASP.NET MVC 3.
  • New code inspections. Access to disposed closures, covariant array conversions and more.

We have also fixed many outstanding issues. Look for more blog posts describing 6.1 features and improvements in future here on the JetBrains .NET tools blog.

dotCover 1.2 and dotTrace 4.5.2 Performance

These are mainly maintenance releases with a primary focus of supporting ReSharper 6.1. In addition, dotCover 1.2 works side-by-side with TypeMock 6.2.x, provides performance improvements in report generation, reduces HTML report size and memory consumption.

Note that we are already working on next major dotCover and dotTrace Performance releases. EAPs are expected soon, exposing a ton of new functionality and improvements, so stay tuned for that.

Download them all!

You can download ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance right now!

Last but not least, we’d like to wish everyone very Happy Holiday season. Stay safe and see you all in the New Year!

ReSharper 6.1: The Finish Line

December 13th, 2011 by Jura Gorohovsky

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!