.NOT

I occasionally still get calls to do software development. Recently, a potential client indicated that they would like a Windows shell extension created in C#. I’ve never built a shell extension, nor done any C#. Before meeting with the client, I decided I should take an hour or two to see how hard it would be for an old-school C++ and COM guy like me to get up to speed.

I downloaded the ‘Express’ version of C# and started playing with it. Pretty quickly, I had a command line app that worked like Eliza, but got the response text from Google searches. Fun!

Next I searched MSDN for information on using C# to create shell extensions. I found this article, which starts out like this:

This article illustrates the process of creating custom shell namespace extensions using C# and the .NET Framework. The author dispels some myths about the difficulty of writing such extensions, and shows that it is easier than it was before .NET.

Sounds good!

Until you get to here:

Because shell extensions are loaded into arbitrary processes and because managed code built against one version of the runtime may not run in a process running an earlier version of the runtime, Microsoft recommends against writing managed shell extensions and does not consider them a supported scenario.

Doh!

Reading up a bit more it seems that COM, not .NET is really the right technology to use. It’s nice to see that my C++ and COM skills aren’t obsolete yet.

Share it!

Leave a Reply

Your email address will not be published. Required fields are marked *