RedGate SQL Source Control
01 Sep 2010
Another tool I tried today. The idea is very cool, but I don’t like the fact that after I “link” the database I suddenly get gazillion changes to commit. I would think that “linking” means submitting current state to the DB. Also, it is not clear how to get rid of the users and roles [...]
RedGate SQL Compare
01 Sep 2010
As per this survey, RedGate SQL Compare is one of the best SQL comparison tools on the market. I downloaded a trial today. It works fast, produces safe synchronization scripts wrapped in transaction, and is generally cool. I did, however, stumble upon a stored procedure that it marked as “different”, although it could not show [...]
Some anti-patterns I am experiencing first hand
31 Aug 2010
I am working on a rather interesting WPF project, which “implements” so many anti-patterns I had to blog about it. The most interesting thing about this project is that it was written by some of the best and smartest programmers I know, so the anti-patterns stem not so much from incompetence, but from general conditions [...]
Can’t have a binding to binding
25 Aug 2010
Let’s say we want to display a list of countries, and depending on the user input we want to show either the capital city, population, or the language spoken in the country alongside the country name, like in the application below: The only way to achieve that is to change binding in code. You cannot [...]
WPF: Merged dictionary parser depends on XML attribute order
13 Aug 2010
Does attribute order in XAML matter? It should not, but sometimes it does. The following XAML compiles, but blows up at runtime with “Item has already been added” exception, both in .NET 3.5 and .NET 4.0: <Window x:Class="MergedDictionaryKeyPosition.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary> <Style TargetType="Button" x:Key="foo" /> <Style TargetType="Button" x:Key="bar" /> [...]
ClickOnce Publisher WTF
12 Aug 2010
Today ClickOnce publisher came up with this message: “The application platform does not match the existing application on the server. Do you want to overwrite it?” What is the platform on the server? What am I replacing it with? This would be one line of code to add this information. But alas, I am left [...]
Database proramming rant
08 Aug 2010
After a long while I am back to dealing with databases directly from ADO.NET. Guys, this is ridiculous. Any serious library designed like that would be heckled. This is what I found (or rediscovered) in the course of one day: if your SqlConnection uses SQL Server local transaction, you must manually transfer the transaction to [...]
VS 2008 unit test host cannot run tests in one thread
06 Jul 2010
Our UI code is single threaded and UI classes use some shared static data. They work just fine, but the unit tests sometimes fail. Investigation led to threading issues. Visual Studio unconditionally runs tests in multiple threads simultaneously, and apparently there is no way to tell it not to do that. http://social.msdn.microsoft.com/Forums/en-US/vstswebtest/thread/4cdd4668-d99c-4699-8e1c-b775498593e7
WPF: Is clone of Freezable frozen?
01 Jul 2010
WPF defines a Freezable type that is a base class for “almost immutable” objects. They can be setup in read/write mode and then “frozen” which makes them immutable and thread safe. Freezables are also cloneable. If I make a clone of a Freezable, will it be frozen? Fortunately, it won’t, so I can modify the [...]
XSLT and Microsoft.NET
29 Jun 2010
While working on XML serializers I wandered into the XSLT land. It turned out that XSLT support in .NET is not stellar. Well, you may already know that, but it is new to me. First, only XSLT 1.0 is supported. It is useful for simple stuff, but even an iteration over a list of known [...]