Successstory: OpenVPN Build 2.1_rc19, released on 16.07.2009, successfully installed on Windows 7 x64!
Archive for the ‘Microsoft’ Category
Windows 7 OpenVPN
05:21 PMMysterious data changes
04:36 PMThis error has cost me almost two days to debug:

Its only symptoms where spurious but widespread changes to a single property. While this is “obviously” human error, these “easy” points would have mitigated the damage done:
- strict type checking: the expression is of type
stringand not of typebool, the C# compiler would have known the difference and issued an error - in-band evaluation: The expression didn’t trigger breakpoints within the MethodName property. This would have pinpointed the cause of the data change immediately
- constant vigilance!
Attaching Events to ListViewItems in WPF
01:13 PMI was looking for a way to attach a MouseDoubleClickHandler to the implicitly generated ListViewItems in a databound control:
<listview ItemsSource="{Binding Instances}" />
For some strange reason all the mouse events seem to be directly routed instead of bubbling like other input events. Only some magic of the framework causes them to be raised for every hit control. This causes the sender to be totally worthless, since it is always the “current” object.
Migrating User Profiles and Outlook
01:07 PMI’ve joined my computer to a Domain. Therefore I migrated my User Profile (under Computer -> Properties -> Advanced System Settings -> User Profiles). It… let’s say: worked.
But I couldn’t save attachments in Outlook.
Can’t create file: Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder
The problem is, that Outlook saves a path to a “OutlookSecureTempFolder” in the registry. This path pointed to my old profile where my new user has no right to write to. I changed the path to my new profile path, restarted Outlook and it worked.
ASP.NET Intellisense in Visual Studio 2008
01:31 PMSince yesterday I had no intellisense for standard ASP.NET Server Controls. Today I found a solution:
http://forums.asp.net/t/1205528.aspx
Quoting from the blog of Mikhail Arkipov (and the same goes for VS 2008)
I blogged earlier that in VS 2005 we switched from using static XML schemas to automatically generating them using reflection on Web controls. XML schemas are generated on demand as you open pages in your Web site. They contain information about ASP.NET controls, custom and user controls. You can find generated files cache in
C:\Documents and Settings\[Username]\Application Data\Microsoft\VisualStudio\8.0\ReflectedSchemas
For Vista:
C:\Users\[Username]\AppData\Roaming\Microsoft\VisualStudio\9.0\ReflectedSchemas
XmlSerializer and Nullable<T>. A recipe.
02:45 PMWhen I tried to serialize a class with an Double? property as attribute, XMLSerializer died with its usual and oh-so-unhelpful cascade of InvalidOperationExceptions. The actual error message was:
Cannot serialize member ‘SomeValue’ of type System.Nullable`1[System.Double]. XmlAttribute/XmlText cannot be used to encode complex types.
Since XML attributes have very well-defined null semantics, I was pretty stumped, but soon I found the Allow override for XmlSerializer Nullable<T> attribute behavior feature request on Microsoft Connect:
Unfortunately, this change would be too large to take and would be a new feature rather than a bug fix. We are trying to minimize new feature work in the XmlSerializer, partly to reduce regression risk, and focus our effort on the next-generation serialization technology. Unfortunately, we have decided to resolve this as Won’t Fix.
So I went back the the trusty old *Specified property of XmlSerializer and hacked together a micro-pattern to support Nullable<T> for serialization to an XML attribute:
A quick sketch of asynchronous View Models
01:13 PMThe How to make a loading graphic in WPF XAML? question on stackoverflow reminded me, that I wanted to write a short piece about the WPF infrastructure I’m currently writing. A first part was the Doing GUI architecture the Right Way where I describe the basic advantages of the View Model. Today I’m going to show some details of how this enables very smooth removal of background tasks from the UI Thread. Beware that this is work in progress, so edges might be rough.
The basic structure is three-fold: the Model where the actual data resides, the View which interacts with the user and the View Model as a intermediate layer. I will start out with describing the View, which is really thin. Afterwards I’ll talk a bit why the Model alone is not enough. In the last part I’ll describe my approach to filling the gap.
PuTTY: default to UTF-8
03:53 PMThere are quite a few posts on how setting the “Window > Translation > Received Charset” of PuTTY to UTF-8 helps when connecting to current UTF-8 base Linux systems.
I’ll just add this snippet of code, which can be used as putty_utf8.reg to fix this up in a single double click:
[HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions\\Default%20Settings]
"LineCodePage"="UTF-8"
.Net microbenchmarking
06:05 PMIn a recent discussion on StackOverflow about performance of arrays vs. lists and for vs. foreach, Jon Skeet created a little microbenchmarking framework and posted his detailed findings on his blog.
First, my local results of the benchmark. I compiled them as Release under VS 2008 SP1. Running without debugging on a Q6600@2.40GHz, .NET 3.5 SP1. They pretty exactly match Jon’s numbers so I won’t duplicate them here, but you can find them in the page’s source.
============ Doubles ============
============ double[] ============
For 1,00
ForHoistLength 1,00
ForEach 1,00
IEnumerableForEach 8,28
Enumerable.Sum 8,27
============ List
For 2,00
ForHoistLength 1,43
ForEach 6,02
IEnumerableForEach 14,03
Enumerable.Sum 14,04
============ Ints ============
============ int[] ============
For 1,00
ForHoistLength 2,06
ForEach 1,38
IEnumerableForEach 15,46
Enumerable.Sum 16,06
============ List
For 2,84
ForHoistLength 3,53
ForEach 4,86
IEnumerableForEach 26,33
Enumerable.Sum 26,33
Out of interest how the differences are when there is more to do in the loop’s body, I added a test suite that formatted the sum as string and appended it to a StringBuilder:
OneNote, Vista and Sharepoint
10:26 AMI’ve played a little bit with the OneNote Sync feature. On my new installed Laptop syncing with a Sharepoint Site worked great. But on my PC it didn’t work. OK – that PC was upgraded from Windows XP to Vista. That means that I do not have a standard Vista configuration.
The errormessages/symptoms where:
- Unable to open a Notebook on Sharepoint: The folder name is not valid
- Unable to create a new Notebook on Sharepoint
Uncle Google told me that: