# Monday, January 05, 2009

image
The best time to produce loads of code is when It’s cold outside …

Life | Misc
Monday, January 05, 2009 11:44:42 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, December 24, 2008

That's all folks.

Wednesday, December 24, 2008 5:55:46 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, December 06, 2008

I'm currently working on a project together with Jürgen Bayer (autor of the C# 2008 Codebook and the Visual C# 2008 Kompendium) that makes use of a lot of dependency injection. The configuration files are blown with fully qualified assembly names but how do you get them? Working for instance with custom providers for ASP.NET membership, ASP.NET profile or ASP.NET roles gets you in the same circumstances. In the past I fired up Red Gate's Reflector and loaded the needed assembly to copy the name. I like Reflector but that approach becomes pretty annoying. So I fired up my IDE and hacked down the following peace of code:

using System;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.Win32;
 
namespace devcoach.Tools.AssemblyNameReader
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            // Install shell extension ...
            if (args == null || args.Length == 0)
            {
                using (var regkey =
                    Registry.CurrentUser.OpenSubKey("Software\\Classes", true))
                {
                    if (regkey == null) return;
                    using (var dllFileKey = regkey.CreateSubKey("dllfile"))
                    {
                        if (dllFileKey == null) return;
                        using (var shellKey = dllFileKey.CreateSubKey("shell"))
                        {
                            if (shellKey == null) return;
                            using (var readAsmNameKey =
                                shellKey.CreateSubKey("ReadAssemblyName"))
                            {
                                if (readAsmNameKey == null) return;
                                readAsmNameKey.SetValue(
                                        string.Empty,
                                        "Copy full name to clipboard...");
 
                                using (var commandKey =
                                   readAsmNameKey.CreateSubKey("command"))
                                {
                                    if (commandKey == null) return;
                                    commandKey.SetValue(
                                        "",
                                        string.Concat(
                                            "\"",
                                            Application.ExecutablePath,
                                            "\" \"%1\""));
                                }
                            }
                        }
                    }
                }
                return;
            }
 
            Assembly assembly = null;
            try
            {
                assembly = Assembly.LoadFile(args[0]);
            }
            catch(Exception){}
 
            if (assembly == null)
            {
                MessageBox.Show(
                    "Error loading assembly...",
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                return;
            }
            var name = assembly.FullName;
            if (string.IsNullOrEmpty(name)) return;
 
            Clipboard.SetDataObject(name, true);
        }
    }
}

Now I can use the a right click on any assembly to copy its fully qualified name to my clipboard.

image

Saturday, December 06, 2008 9:25:46 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, December 05, 2008

Kostja invited Michael and me to speak at the next event of the .net user group in Frankfurt (Germany). We'll show some real project implementations and tell stories from the technology and architecture trenches.

The event will be hosted at Microsoft in Bad Homburg. Further details can be found here...

Friday, December 05, 2008 3:06:07 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, November 12, 2008

image 

The user group met today at netzkern, a company in Wuppertal specialized in .net development and SiteCore - thanks the venue and drinks! Thanks to Matthias for the pic!

This time we had "Sliverlight 2 in the real world" as a topic presented by Florian Kruesch. He presented new visual features as well as use cases and projects he's working on. Because he didn't touch the non-visual stuff like Isolated Storage he invited me to show something that I've build with the bits:

The "Silverlight Cache" for javascript - most commonly used to cache json returned by web services.

image

A lovely way to reduce traffic :-)

Wednesday, November 12, 2008 10:23:58 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |