estoy usando el siguiente código para hacer referencia a un archivo DLL cáscarahacer referencia a una interfaz de shell de Windows utilizando .NET 4.0
Type t = Type.GetTypeFromProgID("Shell.Application");
Shell s = (Shell)Activator.CreateInstance(t);
Console.WriteLine("success");
Console.ReadLine();
Funciona bien en mi Windows 7 machine.But desarrollo, cuando trato de ejecutar el exe en Windows 2003 servidor consigo esta excepción
Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3
2.Shell'. This operation failed because the QueryInterface call on the COM compo
nent for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed
due to the following error: No such interface supported (Exception from HRESULT:
0x80004002 (E_NOINTERFACE)).
tomé algo de ayuda de C#: Referencing a windows shell interface pero no hubo suerte.
estoy referenciación shell mediante controles Microsoft depósito y referencia de automatización que es Interop.Shell32 DLL
Si alguien puede guiar lo hará realmente útil.
Es viejo, no creo que los GUID han cambiado, pero quién sabe. Ejecute regedit.exe en esa máquina y navegue hasta HKCR \ Shell.Application. Verifique que el valor de la clave CLSID sea {13709620-C279-11CE-A49E-444553540000} –
Existe una solución más simple, consulte http://stackoverflow.com/a/24967301/625349 –