There are many .NET developers that can’t live without Jetbrain’s R# product. I’m not really one of them. Don’t get me wrong, I like the idea of R# and some of the features it offers, it’s just that it could be so much better if it didn’t keep getting in my way!

Let’s get something out of the way before I dive into what I’d like to see improved in R#: I bought my own R# license out of my own money. I do think it’s a fairly reasonably priced product for all the features it offers.

Improvements I’d like to see

  • More modularity: I work in a fairly specific environment where some of the tools R# provides don’t help at all, and in fact, I don’t need them or want them in my way.
    Hence, I’d love to see top-level options to turn off broad features. Right now pretty much only two features have this: IntelliSense and Code Analysis. I’d love to see the same for things like code formatting and the like.
  • Better options for saving/sharing settings: It’s a pain in the neck to configure R# after installing it (or keeping it configured after that). The Options dialog is a mess, and there are way too many settings and no easy way (that I can find) to export your settings to a file I can save and keep around for later installations.
    Yes, I’m aware that R# saves its settings in an external XML file you can save, but it’s stored some place I can never remember, gets overwritten and messed up all the time when running multiple VS options at the same time and I always forget to fish it out before dumping a VM or something, so it’s as if it was never there.
    Just give me a way to export/import settings; that’s a lot easier to live with.
  • Unit Testing: I’m rather happy using the test runner in R#, use it all the time. However, it would be really nice if there was a way to set it up so that the Debug option worked for mixed managed/unmanaged solutions.
    Right now, the Debug option only enables the managed debugger, but I also work with lots of code that includes managed tests over a mixture of managed and unmanaged C++ code and to debug that I always have to use the NUnit test runner instead.

Things that just piss me off

There are a few things that I can’t stand when using R#, however; to the point where I have to disable it just to get any work done without losing my mind:

  • Crashes: R# 4.5 was notoriously unstable. It would crash all the freaking time for me. R# 5.0 seems better on VS2010, but not on VS2008 to the point where the simplest reproducible crash that R# 4.5 would cause is still present in 5.0. Here’s just an example: Launch a new, empty VS2008 instance (with no auto-project opening or anything), then drag a C# file from explorer to VS. Watch VS crash and burn.
  • Stop messing with ViEmu: I’m a long time user of ViEmu, absolutely love it. However, R# often messes with ViEmu on VS2008, in particularly with the keyboard handling. The one that always causes me trouble is firing a new empty VS2008 instance and loading a solution that contains only unmanaged C++ projects, where R# shouldn’t even get involved, and watch the keyboard go all crazy on you.
    Only way to work when this happens is to disable the R# add-in temporarily, which is really annoying. I know people love R#, but for me ViEmu >>> R#. Mess with ViEmu and it’s you that’s getting canned.
  • Smarter Settings: Given my concerns about making it easier to export/import my R# settings, and my desire to disable code formatting, it’s not surprising this is an issue for me.
    See, I already have all my VS code formatting rules properly configured and persisted in my .VSSETTINGS file. Install VS again and in seconds its there. Install R# and instead of defaulting its own code formatting rules to my existing VS settings, it applies its own coding conventions. That’s just disrespectful and annoying, to be honest.

Anyway, let’s see how life with R# 5.0 goes. So far, the VS2010 integration seems nice, but I will still be primarily a VS2008 user for a long time, so it sucks a lot that stability there hasn’t improved.

This is my first color scheme specifically created for Visual Studio 2010; I’m not likely to port it back to VS2005/2008 but I’m sure it would be possible if someone cared enough about it.

I started this color scheme on VS2008 but never completed it. When the Visual Studio 2010 betas started coming out, I imported it there and started tweaking it though a lot of revisions here and there as I used it. It’s been pretty much what I’ve been using for all my VS2010 development.

Code

Metroline - Code

XML

Metroline - XML

Download the most up to date .vssettings file for Metroline.

I only use WinDBG every once in a while, but, when I need it, I really need it and need it now. Kevin Dente pointed out earlier today that apparently, the latest versions of WinDBG was not available as a standalone installer, but only as part of the Windows Driver Kit ISO download.

That’s right. You now need to download a 620MB ISO, find a tool to open it up with (since Windows still lacks native support for opening ISO files directly) to extract a 17MB installer for WinDBG. From the WinDBG download page:

This current version of Debugging Tools for Windows is available as part of the Windows Driver Kit (WDK) release 7.1.0. To download the WDK and manually install Debugging Tools for Windows:

1. Download the WDK and burn the ISO to a DVD or other installation media. (The WDK ISO file is approximately 620 MB to download.)

2. Open the ISO from the installation media and open the Debuggers directory.

3. In the Debuggers directory, run the appropriate MSI or setup EXE for x86 and follow the instructions in the Setup Wizard.

4. After installation is complete, you can find the debugger shortcuts by clicking Start, pointing to All Programs, and then pointing to Debugging Tools for Windows (x86).

This really sounds awesome, on par with other MS utilities that get distributed as an MSI installer that installs an MSI installer that you can install. Yes, I’m being sarcastic.

Get it together, Microsoft; WinDBG is too important for support to screw it up like this.

It has been brought to my attention that a hotfix has been released for the BizTalk Server 2009 developer tools that should fix the problem I mentioned a few months ago with referencing WCF services within the same BizTalk project as the orchestration that uses them.

I haven’t tried it yet, but I thought someone might be interested in it.

I’ve been noticing some oddities in how Visual Studio 2010 RC handles Custom ClassificationFormatDefinitions when multiple extensions are interacting together. It it hasn’t been fixed already, then I guess it’s already too late for it to matter, but I still wanted to bring it up just to know if it’s just me that’s been noticing this.

As some readers are aware, I’ve written a couple of VS2010 extensions for myself which I always install as soon as I setup a new VS2010 installation, and so far I’ve been very happy with the results and VS2010 extensibility in general. Both of these extensions define custom ClassificationFormatDefinition, whose format I then tweak on my current VS color scheme.

And this generally works great. That is, until I install another extension created by someone else. The first time I noticed this was when I installed the Visual Studio Color Theme Editor extension by Matthew Johnson. Everything worked fine, except that after using it a bit I realized that every time I changed the color theme for the whole IDE using Matthew’s extension, my custom ClassificationFormatDefinitions would revert back to the default formats specified in the original definitions in code, instead of the values I had assigned to them in my customized VS color scheme.

Re-importing the .vssettings file with my saved VS color scheme would get colors and formats right again, so, to be honest, I didn’t give it much thought at the moment.

Yesterday, however, I ran into this again while trying VsVim by Jared Parsons. As soon as I fired up VS2010 after installing VsVim, I noticed that custom formats for my own definitions reverted once again to the default values. I ran into a couple of issues with VsVim so decided to disable it for now while until I had time to look into it closer and imagine my surprise when right after restarting VS2010 my customized format definitions came up right away instead of the default values!

So my impression is that something (but not sure what) causes VS to ignore customized custom definition formats configuration (confusing, I know, sorry) when multiple VS extensions are running. Has anyone else run into this before?

Both Visual Studio 2008 and 2010 have a rather annoying issue relating to how XAML is highlighted in the Text Editor. I’ve complained in the past that the XAML designer team introduced a separate set of classifications (i.e. options in the Fonts and Colors dialog) to configure how XAML code would be highlighted by the editor, when in fact, it is just, for the most part XML and it would’ve been used if the XAML editor just used the same color definitions used by the XML editor.

However, this isn’t 100% true. It turns out that the XAML code editor uses the colors and font settings configured for String (e.g. like a C# string) to render raw text inside an XML element in the XAML code. Normally, this isn’t too much of a problem, until you create a color scheme that uses a custom background color to highlight strings. Then, this is what you end up with in XAML:

Xaml_Before

Notice how the different background is used to render even spaces used for indentation, which looks very, very ugly.

Now, there’s nothing I can do about VS2008, but at least with VS2010, I was able to write an extension that fixes this problem. Here’s how it looks with the extension enabled:

Xaml_After

Much better, right?

Here’s basically all the code needed to fix this:


[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("XAML")]
[Name("XAML Fix")]
[TextViewRole(PredefinedTextViewRoles.Document)]
public class XamlFixCreationListener : IWpfTextViewCreationListener {
   [Import]
      IClassificationTypeRegistryService registry = null;
   [Import]
      IClassificationFormatMapService mapService = null;

   public void TextViewCreated(IWpfTextView textView) {
      var formatMap = mapService.GetClassificationFormatMap(textView);
      var textClassification = registry.GetClassificationType("text");
      var stringClassification = registry.GetClassificationType("string");
      var props = formatMap.GetExplicitTextProperties(textClassification);
      formatMap.SetExplicitTextProperties(stringClassification, props);
   }
}

As usual, you can get the code for the extension from github. Enjoy!

Windows 7 has some nice and very welcome functionality for attaching/detaching VHD files so that you can access files in them directly from the operating system, which is something I’ve been finding very useful when working out of my laptop. Unfortunately, it’s a bit of a drag to have to go through disk manager every time I want to use one of my VHD files.

I started looking for a way to do this from the command line and discovered that diskpart.exe can do it, but the syntax is more than I can usually remember, so I just wrote these two quick PowerShell functions:

function add-vhd($vhdfile) {
   $path = resolve-path $vhdfile
   $script = "SELECT VDISK FILE=`"$path`"`r`nATTACH VDISK"
   $script | diskpart
}
function remove-vhd($vhdfile) {
   $path = resolve-path $vhdfile
   $script = "SELECT VDISK FILE=`"$path`"`r`nDETACH VDISK"
   $script | diskpart
}

Following the release of Visual Studio 2010 Release Candidate, I installed it on one of my laptops. I ran into some minor issues with the Silverlight dev tools SDK, but I hear they’ve been resolved for RTM. Other than that, it seems to be working fine.

I’ve already updated my Current Line Highlighting and Keyword Classifier extensions for the RC, so they should be ready to go if you build them from source.

vs2010

Jeffrey Knight was kind enough to point out a small missing thing in the expressions for built-in variables in my modified syntax file for PowerShell scripts for Vim. I’ve now updated the syntax file in my github repository following Jeffrey’s suggestion and also fixed another related issue while at it.

Thanks Jeffrey!

On the topic of debugging skills, there are many things said and to be said, but I thought I’d take a moment to reflect on a few skills I believe BizTalk developers should develop to solve problems on their solutions effectively (in no particular order):

  1. Trace the execution of BizTalk processes end-to-end, covering both messaging and orchestrations. While this seems obvious at first, it can be tough on complex solutions that rely heavily on pub/sub and direct binding!
  2. Discovering the reasons why a service instance might be getting suspended. In particular, quickly finding any possible exception information coming from faulted instances.
  3. Using the orchestration debugger to figure out where a given Orchestration instance is getting suspended.
  4. Matching any receive shapes in an orchestration to the origin of messages coming for it. This might require matching logical ports with physical ports as well as possible direct-binding sources of messages.
  5. Tracking possible reasons for routing failures, particularly when correlations are involved. This includes being able to understand routing failure reports, checking the state of any required promoted property, comparing subscription information either directly on the message box as well as from reading orchestration code, and so on.
  6. Detecting and solving situations that stop flow/processing of messages, related to thread pool issues or thread starvation.
  7. Detecting zombie message instances and their possible consequences.
  8. Knowing how to enable the BAM tracing infrastructure to debug and solve issues with BAM not writing data to the BAM primary import database.
  9. Using the Visual Studio Debugger or WinDBG to debug BizTalk processes. This includes figuring out the right processes to attach to!
  10. Debugging assembly-loading/versioning issues. This includes how to use Fuslogvw.exe and friends.

Anyone else has any other ideas?