.NET 3.5 SP1 Beta and Real Life

While there are many nice improvements in the .NET 3.5 SP1 Beta (see here, here or here), there are problems too, unfortunately… Yesterday we spent half a day trying to understand why absolutely simple and legitimate piece of XAML is not opening in Blend 2. The code looks like this (relevant part of it):

<Window.Resources>
  <Style TargetType="{x:Type ListBoxItem}" x:Key="LBIS">
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  </Style>
  <ControlTemplate TargetType="{x:Type ContentControl}"
    x:Key="CT">
    <ListBox ItemContainerStyle="{StaticResource LBIS}"/>
  </ControlTemplate>
</Window.Resources>
<ContentControl Template="{StaticResource CT}"/>

Simple, isn’t it? Well, it is not! Blend is choking on the Setter of FocusedVisualStyle in the ListBoxItem’s LBIS style with ” XML namespace prefix does not map to a namespace URI, so cannot resolve property ‘FocusedVisualStyle’. FocusedVisualStyle can be substituted by almost any other property of the ListBoxItem, although some of them, e.g. Width or Opacity will work.

On the other hand, following XAML will open nicely (ListBox is not inside of the template anymore):

<Window.Resources>
  <Style TargetType="{x:Type ListBoxItem}" x:Key="LBIS">
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  </Style>
</Window.Resources>
<ListBox ItemContainerStyle="{StaticResource LBIS}"/>

Both snippets open nicely in Blend 2 on a machine without the SP1 beta. As we need Blend 2 and do not rely on anything SP1-specific, I decided to uninstall SP1 beta. And here comes the problem – it is “mission impossible”. I have spent half of the last night trying to get rid of it, all in vain. I have tried everything, including Automated cleanup tool to remove the .NET Framework by Aaron Stebner (which by the way managed to completely remove .NET 3.5 – nice job, Aaron!!!). But the result is the same – Blend 2 is irreparably broken. I cannot even reinstall it as installer complains about “Unknown product…” and I cannot do anything about that – cleaning registry, monitoring installer’s activities, etc. did not help. Visual Studio 2008 is broken too now, but that is another story.

Microsoft guys know that Blend 2 is not really compatible with SP1 Beta of .NET 3.5, and recommend waiting for the release version of SP1. On the other hand, Blend 2.5 March CTP Refresh seems to work fine in this scenario.

I have to reinstall Windows now, which is not a problem per se, as I was planning it for some time now anyway, but one would expect that this kind of basic/primitive errors would not exist in beta product – we are not talking about an “advanced” scenario in this case.

PostSharp

PostSharp is a free and open source aspect-oriented programming (AOP)/policy injection framework that can reduce the number of lines of code and improve its logical decoupling by allowing encapsulation of e.g. transaction management, logging, caching, or security aspects as custom attributes. Own custom attributes can be developed that will add new behaviors to code.

Today’s Sites/Blogs

Today’s CodeProject Articles