Archive for the ‘Tips & tricks’ Category
The importance of the order of routes in ASP.NET MVC
Last week I had the pleasure of listening to a presentation from Scott Guthrie here in Stockholm, http://weblogs.asp.net/scottgu/archive/2009/12/06/my-presentations-in-europe-december-2009.aspx. One of the most interesting parts of the all day event was his talk about ASP.NET MVC 2. Yesterday I had some time off and started to try things out using Visual Studio 2010 Beta 2 and the ASP.NET MVC 2 template. It was running smoothly for a while until I bumped into a problem I recognized from earlier. I didn’t remember the solution right away, but soon I figured it out what was the key point in making the routes, registered in Global.asax, work properly.
The order when adding the routes using the MapRoute method on a RouteCollection object is important to avoid getting a 404 page when browsing to pages that are supposed to work. I will present the problem and the solution for it below.
Using the Enumerable Class methods and lambda expressions
This article presents nothing new at all, but sometimes it is nice to freshen your memory when it comes to smooth stuff available in the .NET Framework. I will give a couple of examples to select, count and look up elements in a collection of objects, both using regular functions and by using lambda expressions. The methods I will use are available when using .NET Framework 3.5.
The complete documentation is available on MSDN, in System.Collection.Generic Namespace documentation.
SQL Server 2008 spatial data with BLToolkit (cont’d)
Right after I published the previous post on the spatial data and BLToolkit components I decided to write a follow-up on that post. I wasn’t happy about the way I described the implementation of the new property and field attribute to support the SQL Server UdtTypeName property and spatial data types. I hope I will make it more clear how I accomplished the support for this here. Please read the previous post about this on, .
Broken TinyMCE with WordPress 2.7
After upgrading my WordPress installation to version 2.7, the TinyMCE editor was broken. I “googled” around like a maniac trying to find a solution to this. After a while I found out that it wasn’t the TinyMCE itself causing the problem, but instead the RB Internal Links plug-in.
Implementing a custom SOAP extension
In this article I will explain how to implement a custom SOAP extension to be able log all incoming and outgoing SOAP messages passing through a .NET web service.
Sometimes the IIS log file is not enough when debugging or looking for errors in a web service. Let’s say that the web service works like a charm in the development environment, but then when a third party user starts invoking methods in the production environment it stops doing what it was built for. Then you have a need for this little extension, letting you log and analyze all incoming messages as well as the outgoing.
Time synchronization in Linux (Ubuntu Server)

As I have installed and administrated a bunch of Linux servers as virtual machines, I have had trouble keeping the time correctly. There is always a small drifting going on in virtual machines and a number of different ways to keep them synchronized with the host operating system.
Nowadays I have left that struggle behind letting the virtual guests keep themselves and their clocks correctly set.
“Saving changes not permitted” (SQL Server Management Studio)
Earlier I have written about the SQL Server 2008 and its tools and pointed out the best improvements in this new release. After a while I have on several occasions bumped into one very annoying thing, when designing databases using the Management Studio.
Suppose you have created a table using the designer. The table has a column ID, set as primary key, but you forgot to specify this column to be “Identity Specification = Yes”. Open the table in design view and set theĀ ”Identity Specification = Yes” and try to save the changes… In my case it fails every time even though the table is empty and contain no data at all, giving the error message:
“Saving changes is not permitted. The changes you have made…. …. or enabled the option Prevent saving changes that require…“, [Cancel] [Save Text File].
Finally I found the option to be modified!!!
VMware Server 2.0 on Ubuntu Server 8.04
On September 23 VMware released a new version of the free edition of their virtualization product VMware Server, version 2.0 (build 116503).
I have used the old versions of VMware Server a lot when running web sites, developing and testing software and techniques so I was very keen on trying the installation of this new release. Since I run this site on a virtual Ubuntu Server, using Ubuntu Server as host, I wanted to install the new VMware Server on a freshly installed Ubuntu Server 8.04.
To install the old versions of VMware Server correctly a lot of extra packages were needed on the host machine, such as x-window-system-core and xspecs. I’m not sure what all these extra packages do, but I didn’t like the fact that they had names like x-this and x-that. The machine running VMware Server has the server edition of Ubuntu installed for the simple reason that it is a pretty old thing and therefore it felt good not to install any X Window system.
.NET and spatial data (with SQL Server 2008), part 2
The other day I published a post about the spatial data support in SQL Server 2008 and using the new data types in a .NET application. I decided to write about “the rough way” and promised to publish an article about how to use DataSet designer and TableAdapters… Here it is!
I will try to present an example to accomplish the same result as in .
.NET and spatial data (with SQL Server 2008), part 1
As I wrote in my post the other day about SQL Server 2008, I would present some examples on how to use some of the new data types supported in SQL Server 2008 when developing .NET applications.
I “googled” the subject and found a couple of blogs about it. I wasn’t able to find anything on MSDN, except on the Forums. The information on the forums was somewhat useful, so I started off…