Thursday, October 09, 2003

Debugging a shell extension is not easy!

The last couple of days I've been working on a shell extension written in C#. The idea was to provide thumbnails for some custom file types rather than have some kludgy file browser encapsulated in the application.

I've found out a lot about the difficulties of writing a shell extension. Particularly debugging which seemed to be impossible at first glance. The extension is run by the system and doesn't show up in any recognizable form in the task manager. I did find out though that if you attach the debugger to the Explorer process you can stop the extension with the debugger.

Once used, the shell extension is kept alive by the system so any changes you make will fail to create the new dll because its in use elsewhere. Just terminate the Explorer process and the problem goes away. Sometimes Explorer starts on its own again so that you have access to the start menu and such, sometimes it needs running explicitly.

No comments: