2

我在 C# 中使用 Shell 扩展创建了非常简单的上下文菜单。它在 Windows XP 32 位下运行良好,但在 Windows 7 64 位下没有出现菜单项。

我尝试将安装程序输出构建为 x64,但没有效果。

简单源包含 ContextMenu 和安装项目在这里

看起来 Wow6432 应该由安装项目处理,注册和添加到全局程序集缓存也是如此

我将不胜感激有关此问题的帮助/建议。

4

3 回答 3

3

我必须强烈建议您远离 Esposito 编写的任何代码。像往常一样,他在 ShellExt 文件夹中的 P/Invoke 声明是完全错误的,它们不能在 64 位代码中工作。首先发布这段代码是非常不负责任的,shell 扩展永远不应该使用 4.0 之前的 .NET CLR 版本。如果你想拯救它,请访问 pinvoke.net。

于 2010-04-13T18:55:12.760 回答
1

Check the DLL's platform in Visual Studio and make sure it's 64-bit. 64-bit processes can't load 32-bit DLLs into their process space (and vice versa, naturally).

To build a 64-bit version of your DLL, use Visual Studio's Configuration Manager to create a new solution platform. Select X64 (instead of X86 or any platform), and rebuild the project. There are also command-line switches for C# compiler, if you are using scripted builds.

于 2010-04-13T17:47:57.297 回答
0

我也有同样的问题。您需要更改安装文件中的 InstallUtil.dll。我在我的博客上写了一篇关于它的文章。 http://artyomgrigor.wordpress.com/2010/10/06/register-shell-extension-context-menu-also-on-windows-x64-part-2/

于 2010-10-13T14:52:30.480 回答