Archive for May, 2008

17
May
08

.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.

13
May
08

.NET 3.5 and VS2008 SP1 Betas

Microsoft released SP1 Betas of .NET 3.5 and VS2008. More info is available from Tim Sneath, Scott Guthrie, and, related info about shaders from Greg Schechter.

12
May
08

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.

11
May
08

Today’s Sites/Blogs

11
May
08

WPF: A Beginner’s Guide

Sacha Barber (see his blog) wrote (will continue to write?) excellent “WPF: A Beginner’s Guide” series on CodeProject:

11
May
08

Today’s CodeProject Articles

11
May
08

Algorithms for the Masses

By accident found Algorithms for the Masses web-site and blog by Julian M. Bucknall (who is CTO at DevExpress). Plenty of interesting articles and posts, especially on algorithms and data structures (including their lock-free implementations).

11
May
08

Measure Early and Often for Performance

The CLR Inside Out column of the MSDN Magazine has absolutely great article about .NET performance – “Measure Early and Often for Performance” (Part I, and Part II).

11
May
08

JIT Optimizations

Sasha Goldshtein’s JIT Optimizations article on the CodeProject shows some of the optimizations the JIT compiler is able to do and explains what is affecting them. Interesting.

11
May
08

Using MVC to Unit Test WPF Applications

11
May
08

Memory Leaks in WPF