Programmatically specify Private Extension Gallery in Visual Studio 2012

拟墨画扇 提交于 2019-12-07 14:03:08

问题


One of the newest features in VS 2012 is the ability to create Private Extension Galleries, which allow you to build your own extension repositories and not have to publish them to the world (internal company tools, etc.). I've successfully created one as described in the MSDN blog I referenced, but I'm wondering if anyone knows of a way to programmatically set the details of the gallery - the name and URL, and then "Apply" it - so that each person who wants to access it doesn't have to manually enter in the info.

I looked in the registry to see if I could install a key, and I think it's possible but not exactly trivial. Anyone have any insight?


回答1:


The registry keys to set are documented under http://msdn.microsoft.com/en-us/library/hh266735.aspx. $RootPath$ would indicate a path like HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0 on the user's machine. Minimally, you could write a little tool that just sets those registry keys.

If you want to be really fancy, you could take that .pkgdef example and stick that inside a .vsix. Then, installing that extension would register the private extension gallery. A bit meta, but that could prove useful.




回答2:


I'm going to mark Jason's answer as accepted, because he pointed me in the direction of how to properly do it which was my ultimate question. However, I do want to add another solution which does work if this is all you need:

If you manually add your private gallery details to Visual Studio, your registry key will be created for you. Go to:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\ExtensionManager\Repositories\[Dynamic Guid]

and export that key to a normal .reg file. You can then either create a simple batch script to install the key for you on other computers, or just have people use the .reg file to install it themselves.



来源:https://stackoverflow.com/questions/14524606/programmatically-specify-private-extension-gallery-in-visual-studio-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!