Shell extensions with .NET 4.0

前端 未结 3 1869
無奈伤痛
無奈伤痛 2021-01-12 21:33

Any one have any docs or examples of how to add menu items to the explorer shell with .NET.

Can only find info saying it should be possible now with .NET 4.0 but not

相关标签:
3条回答
  • 2021-01-12 21:52

    Even using .NET 4, with side-by-side execution, writing a managed shell extension might not be a good idea: According to Microsoft employee Jialiang Ge, "Microsoft [...] has not determined whether it will support managed shell extensions for the long term [...] Microsoft [...] will not support managed shell extensions and recommends against writing them."

    0 讨论(0)
  • 2021-01-12 21:52

    The latest release (currently All-In-One Code Framework 2011-8-8 Aug 8 2011) of the All-In-One framework does not include these samples any more. Think MS removed formal support for managed shell-in's.

    However I can confirm they are still available from All-In-One Code Framework 2010-09-06 http://1code.codeplex.com/releases/view/51868

    Updated:

    Documentation has a bug in it. To install the created shell extensions on a x64 machine use the 'Visual Studio x64 Win64 Command Prompt (2010)' to run the regasm commands. This command prompt get's installed as part of the c++ stuff in Visual Studio setup but is essentially the following command:

    %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" amd64

    0 讨论(0)
  • 2021-01-12 21:54

    MSDN Magazine had an article about managed shell extensions long back in 2004:

    Create Namespace Extensions for Windows Explorer with the .NET Framework

    I don't think that the basic mechanism has changed in .NET 4.0. The difference though is that with .NET 4.0 you can safely ignore the red warning on top of that article ("...Microsoft recommends against writing managed shell extensions...") because version 4.0 of the CLR can be hosted side-by-side with other versions in the same process. This has previously not been possible.

    Update:

    The All-In-One Code Framework now contains an example for managed shell extensions (CSShellExtContextMenuHandler).

    0 讨论(0)
提交回复
热议问题