Troubleshooting SharpShell Servers
Creating Shell Extension Servers can be extremely difficult, as diagnosing issues is very hard. The most common problem encountered is that a server seems to work with the ServerManager tool, but simply doesn't show up at all in Windows Explorer. This page
pulls together a detailed guide of how to troubleshoot servers.
My Server Doesn't Show Up in Windows Explorer
Perhaps the most common issue. Here are the things to try, in order.
- Make sure that your server class has the [ComVisbile(true)] attribute.
- Make sure that your assembly is COM Visible (Project Properties > Application > Assembly Information... 'Make assembly COM-visible'.
- If you are on Windows 32 bit, make sure you register the server with the x86 version of regasm:
- If you are on Windows 64 bit, make sure you register the server with the x64 version of regasm:
- If you are registering a server that is NOT installed in the GAC, make sure you use the '/codebase' flag for regasm.
regasm MyServer.dll /register /codebase
- Important: For most SharpShell servers to work on anything other than a development machine, they MUST be built in Release Mode against the Release Mode SharpShell binary. This binary uses an unmanaged C++ component that has
a dependency to MSVCRTD100.dll in debug mode - this will NOT be present on none-development machines.
Shell Thumbnail Handlers
Shell thumbnail handlers have some specific things to be aware of:
- Do NOT use 'ClassOfExtension' COM server associations - you must register to a file extension.
- The Server Manager tool doesn't seem to respect alpha channels, but the system does.
Shell Icon Overlay Handlers
If you are not seeing your Shell Icon Overlay handlers after registering, double check which other icon handlers are registered, if you have more than a few then yours may not show up - the system only supports about ten.
On 32 bit systems, it normally takes a restart if explorer.exe for the icon to be loaded. Apparently, this can actually be done programatically via SHChangeNotify.
If you see a cross icon instead of your icon, make sure the build action for the icon is set to "Resource". If this doesn't work, try copying it to the resource folder manually. (See http://www.codeproject.com/Articles/545781/NET-Shell-Extensions-Shell-Icon-Overlay-Handlers?msg=4972010#xx4972010xx).
Shell Property Sheet Extensions
For property sheet extensions to work, make sure that the destination machine has the Visual C++ 2012 Redistributables installed (vcredist_x86 or vcredist_x64).
It seems that under some circumstances, Tab Controls in property sheet extensions can lead to unpredictable behaviour and crashes - currently I recommend against using them until the route cause of this issue is identified. More detail on this issue and
the one above can be found here: https://sharpshell.codeplex.com/discussions/470807
Context Menu Extensions
It seems that sometimes creating the [ComServerAssociation] is not enough. When you add the registry key for the given extension, the context menu may be got from a different part of the registry for the users preference.
For example, for 'png', uou can determine this by checking the user choice:
This will give you the progid gives you the keyname to associate with the server. In this case, it might be WindowsLive.PhotoGallery.png.16.4.
I did this manually and hey presto it works.
If you find your preview handler for Directories is not working on a client machine, trying installing and registering it both both x86 and x64. Thanks
The File Type Verifier
The File Type Verifier tool from Microsoft can also be used to get some diagnostic reports on Shell Extensions associated with file types. Details are here: http://msdn.microsoft.com/en-us/library/windows/desktop/hh127466