简体   繁体   中英

VSPackage: add a context menu item where another extension may conflict

I have installed the Oracle Developer Tools for Visual Studio and I am attempting to create a VSPackage extension for packaging Oracle scripts for release. I would like the extension to work by allowing the user to right click on the deployment script in the Solution Explorer in the Oracle DB project and be presented with a context menu option to bundle the scripts.

I have created the VSPackage project and defined the menu entry. I set it's parent to IDM_VS_CTXT_ITEMNODE. If I run the Visual Studio Experimental Instance, load a solution and right click on any items in the Oracle Db projects the menu item is missing.

Additionally I tried adding a non-sql item (*.cs file) to the Oracle Db project. When I right click on that item in the Oracle Db project, my menu item is not present.

If I right click on any items (a *.cs file, for example) in other project types in the same solution, I see my menu item.

Using PowerShell I queried the IDE for its list of CommandBars and I think I found the Instance ID for the project item (DBProjScriptCtx - 0x0613), but because this is not defined in vsshlids.h I cannot reference it... or at least I cannot figure out how to reference it. So my question: is there a way to get my menu item into the context menu that seems to be owned by the Oracle Developer Tools for VS add-in?

I am working in VS 2013(12.0.31101.00 Update 4) with VS 2013 SDK.

The test solution environment - installed ODAC 12c Release 2 and Oracle Developer Tools for Visual Studio (12.1.0.1.2) and created a solution with one Oracle Db Project and one non-Oracle Db project. Used the Visual Studio Package project template to create the VSPackage.

Thanks in advance for any assistance.

* UPDATE * This item has been resolved - see VSPackage: add a context menu item where another extension may be conflicting

The easiest way to do this, is to figure out what the guid:id pair is for the context menu that is displayed when your right click the deployment script node in the solution explorer. Chances are, they may be displaying an entirely different context menu.

Use the EnableVSIPLogging registry value , to find the guid:id pair of the context menu itself. Then you need to create a group in the .VSCT. Your commands should be parented to the group, and the group should be parented to the Oracle context menu.

You'll need to define the symbols yourself in the .VSCT file, as the VSSDK is obviously not going to have those values it it's own headers :-)

Sincerely, Ed Dore

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM