VS 扩展架构(包 API/Visual Studio 库)
最近我发现了上面显示的来自微软的 Visual Studio 扩展平台图表。
大多数事情我都很清楚。但是,我想知道 Package API 和 VSL(Visual Studio 库)。
我试图找到更多信息,但未能找到任何信息。
我不太明白的事情:
- Package API 到底是什么?
- VSL 到底是什么?
- InteropAssemblies/VSL 和 Package API 之间有什么关系? InteropAssemblies 是否包装对 Package API 的访问?
- 为什么在实现本机包时应该使用 VSL?有什么好处?
有人有关于这些主题的更多信息或者有人知道一些资源吗?
Recently I found the above displayed Visual Studio Extensibility Platform chart from microsoft.
Most of the things are clear to me. However, I am wondering about the Package API and the VSL (Visual Studio Library).
I tried to find more, but was not able to find any information.
Things I do not quite understand:
- What exactly is the Package API?
- What exactly is the VSL?
- What is the relation between the InteropAssemblies/ VSL and the Package API? Do the InteropAssemblies wrap the access to the Package API?
- Why should one use the VSL when implementing a native package? What are the benefits?
Does anybody have more information about these subjects or does somebody know some resources?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“Package API”是 Visual Studio SDK 中公开的一组 COM 接口。这些是 Visual Studio shell 的原始可扩展性接口。几乎所有接口都以“IV”开头(例如 IVsShell、IVsHierarchy、IVsSolution 等...)如果您安装了 Visual Studio 2010 SDK,请查看 %SDKInstall%\VisualStudioIntegration\Common\IDL 的内容更多细节。
您可以将 VSL 视为受 ATL 启发的框架,用于创建本机 Visual Studio 包。如果您从包含的模板创建 C++ Visual Studio 包,则输出将使用 VSL。它的优点是它最大限度地减少了您需要为给定功能编写的“管道”代码量(例如添加新的工具窗口)。
互操作程序集用于.NET/COM 互操作性。它们为托管 (C#/VB/F#) 代码提供正确的方法签名和结构以调用 Package API。
MSDN 上的 Visual Studio 扩展中心是了解更多信息的好地方文档、博客、文章等的链接...应该会对您有所帮助。
The "Package API" is the set of COM interfaces exposed in the Visual Studio SDK. These are the raw extensibility interfaces for the Visual Studio shell. Almost all the interfaces start with 'IVs' (for example IVsShell, IVsHierarchy, IVsSolution, etc...) If you have the Visual Studio 2010 SDK installed, take a look at the contents of %SDKInstall%\VisualStudioIntegration\Common\IDL for more detail.
You can think of VSL as an ATL-inspired framework for creating native Visual Studio packages. If you create a C++ Visual Studio Package from the included template, the output will be using VSL. The advantage of it is that it minimizes the amount of 'plumbing' code you need to write for a given feature (adding a new ToolWindow for example).
The Interop Assemblies are for .NET/COM interoperability. They provide the right method signatures and structure for managed (C#/VB/F#) code to call into the Package API.
The Visual Studio Extensibility center on MSDN is a good place to start for more links to documentation, blogs, articles, etc... that should help you along.
我知道我正在回答一个老问题,但是下面这本书中的内容对我有帮助,这增加了 Aaron Marten 接受的答案 以上:
Visual Studio 2010 和 .NET 4 六合一 (Novak ) [2010]
专门讲了Visual Studio Library依赖于ATL。这本书很旧,涵盖了过时的功能,例如宏和加载项,但它也描述了新概念,例如托管包框架,并且还提供了有关 Visual Studio 内部结构的详细信息。
I know I am answering an old question, but the content in the following book helped me, which adds to Aaron Marten's accepted answer above:
Visual Studio 2010 and .NET 4 Six-in-One (Novak) [2010]
It specifically talks about the Visual Studio Library relying on ATL. The book is old and covers obsolete features such as Macros and Add-ins, but it does describe new concepts as well, such as the Managed Package Framework, and also gives details about Visual Studio internals.