Tag Archives: Information Technology

Easy deployment through virtualisation

A couple of years ago, i think somewhere in 2003, i realised that hardware virtualisation was the way to go. Whenever i talked with people about distributing and deploying applications with a virtual machine image instead of a traditional installer they laughed at me (or atleast gave me a strange look of disbelief). The availability of multiple machines can be represented in a windowing environment through a metaphor of multiple desktops. Anyway, i’m still convinced that there will be a point in time where users have access to multiple applications that run in their own virtual machine. Time will tell.

Pondering about code generation

A while ago i was listening to ‘Kathleen Dollard on MEF and More’ on NET Rocks! and it got me thinking.

For a long time i considered code generation as a way to reduce the tedious parts of software development by spitting out considerable amounts of code and I immediately thought of tools like T4: Text Template Transformation Toolkit and GAT: Guidance Automation Toolkit.

I believe that in order to become more productive we need a solution that requires less code spitting by means of better frameworks and higher languages. Eg: C# allows us to think about computer instructions on a much higher level than assembly language.

And then i realised that the C# compiler is nothing more than a code generation tool!

More on choosing names for tests

Choosing names with the technique i presented yesterday leads to at least one class per method. To tackle that explosion of classes i have made two decisions:

  1. Add a folder for each tested class, this way all the When<MethodName>ing classes are grouped.
  2. Create a single WhenUsing<ClassName> class to group simple test methods.

Here is a screenshot to clarify the changes:

screenshot of visual studio displaying new approach for test naming

Experimenting with naming conventions for unit tests

To be honest, i never really took the time to think about the names of my unit tests. Although i noticed posts like this one and this one they never inspired me to think about it. Earlier this week, Yves Goeleven demonstrated the power of using BDD inspired naming conventions and i was immediately sold. I applied the style on a couple of tests in BeTimvwFramework and i must say that i like the resulting tests:

result of applying bdd-style naming conventions on unittests

The never ending race

You are probably wondering what all these short book reviews are all about. A little longer than two years ago i graduated and became a passionate .NET developer. During these two years i have learned quite a lot (only to find out that there is so much more out there that i know nothing about). Under Book reviews you can find a list of books that have found a place on my bookshelf the last two years. Despite the reading of numerous e-books, articles and blog posts combined with a good portion of experiments i still have the feeling that i have got some catching up to do. Sigh. (Luckily enough i do realize that this is a feeling that will never go away when you have a job in information technology.)

Note about makecert.exe

A couple of days ago i didn’t have a binary version of OpenSSL around so i decided to use Makecert.exe. I generated a couple of test certificates and started playing around with them.

Whenever i tried to decrypt an instance of EncryptedXml a CryptographicException (“Bad Key.”) was thrown and when i tried to use a mutualCertificate11Security assertion (WSE 3.0) the same CryptographicException (“WSE600: Unable to unwrap a symmetric key using the private key of an X.509 certificate. Please check if the account ‘ASPNET’ has permissions to read the private key of certificate with subject name… “) was thrown.

The problem is that by default, makecert.exe generates a key type that is suited for signature. If you want to use the key for other purposes than signing (eg: SSL authentication) you have to use the -sky exchange option. The following commands made my problems disappear:

makecert -n “CN=Client” -pe -ss My -sr CurrentUser -sky exchange client.cer
makecert -n “CN=Host” -pe -ss My -sr LocalMachine -sky exchange host.cer

PInvoke Interop Assistant released

Earlier at Tech Ed North America i heared how Jesse Kaplan, program Manager for Extensibility and add-ins for the CLR team, announced a new tool to help us with PInvoke signatures. Today i noticed that the tool, PInvoke Interop Assistant has now been made available at CodePlex.

Playing with VMWare Server

Earlier today i decided to add an image to my VMWare Server. The creation of the image went smooth but at the end of the process i recieved the following error: Unable to add virtual machine ‘E:\\…..’ to the inventory: Virtual machine is already in the inventory”. When i tried to open the machine via File > Open i recieved the error again. Here is a workaround for this problem: Choose ‘View’ in the menubar and click on Inventory F9. At the left of the screen you’ll see a list of machines that are in the Inventory. If you delete the entries (right click on the machines in the list and choose delete) you’ll be able to Open your newly created machine :)

Automating the configuration of Internet Options / Lan Settings

I got tired of manually changing my Internet Options / Lan Settings. It was really time to say goodbye to the dialog below:

screenshot of lan settings dialog

With the help of How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file i wrote two little files that add/remove the automatic configuration location.The work.reg file looks like:

REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“AutoConfigURL”=”http://192.168.1.99/”

And the home.reg file looks like:

REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“AutoConfigURL”=-

Installing MSDN Library May 2006

Today i downloaded the freely available MSDN Library (May 2006 Edition). I appended .iso to the filenames and mounted the first image with Nero ImageDrive. After a while i got the following error message: “Source file not found: _17693_RTL_x86_enu_NET_Framework_SDK_HxS.cab”.

error message with msdn library installer

Apparently this file exists on the second disk (Why doesn’t the installer ask me to insert the second disk?). And yes, a little while later the same thing happens again when the third disk is expected….