... is not a SharpShell server

Oct 31, 2013 at 8:31 PM
Edited Oct 31, 2013 at 8:38 PM
I downloaded SharpShell in an attempt to find a way to easily build a Explorer extension to display information about MSI files from a contextual menu.

I followed what was quite clear instructions on the CodeProject tutorial but could not get my version to work; Server Manager always says the library is not a SharpShell server. So I tried following the tutorial exactly (changed to C#, did everything exactly). No difference. So I downloaded the SharpShell source code to build the sample ContextMenu project. This builds, but has the same effect. I cannot build the Server Manager as it seems to require something with GitHub, which I cannot do from here (and it doesn't have files anyway); I had wanted to see if there's some sort of internal exception which might tell me what is going on.

In any case, I cannot determine what could be wrong except in one way. I read the CodeProject tutorial as saying Server Manager would be useful to avoid registering the library with the system, to test and debug, etc. Is that the case? If it is, then what else could prevent Server Manager from working? If it isn't, the tutorial is a bit misleading in theat respect. I'll see if I can get a machine to try registering on (I don't want to do my workstation just yet, which was the whole point ...)

Thanks for any feedback.


I've gotten a hold of a machine where I can safely run Server Registration Manager.

If I do this with the demo CountLinesExtension.dll I built, I get the following exception:

Unhandled Exception: System.ComponentModel.Composition.CompositionContractMismat
chException: Cannot cast the underlying exported value of type 'SharpShell.Sharp
ShellServer (ContractName="SharpShell.ISharpShellServer")' to type 'SharpShell.I
at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[
T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClassa1.<Cre
at System.Lazy
at System.Lazy1.LazyInitValue()
at System.Lazy
at ServerRegistrationManager.Application.<LoadServerTypes>b__2(Lazy1 st)
at System.Linq.Enumerable.WhereSelectEnumerableIterator
at ServerRegistrationManager.Application.InstallServer(String path, Registrat
ionType registrationType, Boolean codeBase)
at ServerRegistrationManager.Application.Run(String[] args)
at ServerRegistrationManager.Program.Main(String[] args)
Nov 26, 2013 at 7:46 PM
I see in another thread that some stuff requires the VC++2012 redist, could that be required for things to work and explain the above?
Nov 27, 2013 at 1:48 PM
Hi Keith - I think most likely is that the server and the registration manager were built with different versions of SharpShell - I'd recommend building both again, using exactly the same version of the library and see if that helps :)
Nov 27, 2013 at 2:24 PM
I can't load the ServerInspector or ServerManager projects in the source code, both complain about nuget.targets in the <Import> declaration. Is this because I am unable to reach some online repository or something (we're not visible on public networks here)?
Nov 27, 2013 at 5:24 PM
Yes that's most likely it - there are some nuget references used in both ServerManager and ServerInspector (although ServerInspector is not needed), however, you should see that the only reference that is used (from memory) is Apex which you can download manually and reference, removing all references to nuget. Apex is at https://apex.codeplex.com/