Visual Studio plug-in development

Source: Internet
Author: User

Definition of plug-in

The so-called plug-in, is based on the platform interface developed third-party programs. The first time to hear this noun is not understand, listen to the explanation is not very clear, then we give an example, such as a RV, now there are only basic facilities, but you now want to have a sun on the top of the couch, OK, this function needs you know, how to achieve? Would you like to buy a recliner? Yes, just buy a recliner. If you just bought a recliner, would you be able to install it on top of the RV? That's not going to work, you have to see if there are any screws on the roof of the RV for you to install. As you can see, this screw is the car provided to the user interface, your couch is the plug-in implementation of the function, and the sun loungers installed on the screw column, for different RV must have different methods. So the plugin is developed independently, but he relies on a platform, and the plug in VS is the same thing, vs this platform provides some interface, such as you want to develop editor-related plug-ins, have DTE interface, these interfaces can let you access to the other plug-ins or functions of VS, Your development plugin must also be installed on vs to work properly.

Plug-in types in VS

When I first learned to search the plugin, I found it very confusing, because the plug-in type of VS support is a bit more, so every search one, feel different.
There are many ways to extend visual Studio (even Team Foundation Server), and the VS extension is a generic term for these methods. If there is only one way to extend it, Visual Studio will not be a great Microsoft-style product. For programming, the main way of the VS extension is through the macros, Add-ins, and Visual Studio expansion packages (package).
There are three main ways to develop plug-ins in vs.

  • Macros we are already familiar with macros in office products, and as in office, we can also extend Visual Studio 2008 with macros. This is the simplest way to extend VS-we don't even need the VS SDK. Visual Studio provides functionality that allows us to record macros, macros can access the object model of Visual Studio 2008, and can easily fuse with VS commands and provide very useful, automated property values.
    To be a very professional VS macro developer, you need to know the object model behind the macros and some ways to use them. Visual Studio provides some examples. The best way to do this is to record some macros and then look at the code that you can use to increase your mastery of the macro.
    Although macros are great for task automation, they cannot be used to create entirely new features. In a nutshell, macros take advantage of the Automation interface of the VS IDE, but it doesn't really integrate with vs. When developing with macros, you must realize that anyone can view your source code through a macro.
  • Visual Studio Add-ins Add-ins has more powerful capabilities to extend Visual Studio because it can access all of the object models of Visual Studio 2008 and add new UI elements such as tool windows, Options pages, Menus and toolbar commands, and so on, these added features appear to be part of the IDE. Add-ins also has access to the service provided by the IDE itself and other add-in.
    The brand is also guaranteed because the plugin information appears in the interface that is displayed at Visual Studio startup or in the About dialog box. If you use a macro to expand VS, then everyone can see your source code, but a add-in is a compiled assembly, so you can use some protection techniques like other. NET assemblies to protect your code.
    To publish a plugin, you simply need to create a setup project and compile the. msi file. The MSI program will do all the installation and registration tasks your add-in needs, and you can use the plugin immediately after installation. For some simple functions, the plugin is the simplest way to start. But in this series, I'm not interested in developing add-ins, but the techniques for VS package in add-in, especially how to use the object model provided by the VS IDE, are very useful.
  • The Visual Studio package without a doubt vs expansion pack is the most powerful tool for extending Visual Studio. The most straightforward evidence is that the functionality of the entire Visual Studio is built on an expansion package that is centered on the Visual Studio Shell (shell). All language, editors, debuggers, Project system, and many other components are the package. From the developer's point of view, adding a new VS package is the same as the core functionality of Microsoft Add vs IDE. The VS IDE does not differentiate between the Microsoft-developed package and the third-party developed package. The package can be developed in your favorite language (C #, vb.net, C + +), so they can be as secure as other. NET libraries in terms of intellectual property protection. The VS SDK provides the package installation and Registration tool, Regpkg.exe. Visual Studio checks to see if an expansion pack is legal through the so-called PLK (Package Load key), a plk that can be obtained from the Microsoft site, which is your package's digital hash code. If your package is deployed to a product environment, its plk will be checked. (Translator Note: No need for plk under development and commissioning)

Note: The description of the VS plugin type refers to the blogger's content and can be combined with multiple sources to help you learn. I'm 18 next year.

How to choose a plug-in type

As already mentioned above, the VSPackage is undoubtedly the best plug-in way, for a few reasons, for macro and add-in, VS has gradually abandoned them, which is related to the architecture of the VS platform, VS is actually a platform, or can be said to be a set of VSPackage, It manages these package, many vs comes with the function also uses the VSPackage to develop, therefore uses the vspackage to develop the plug-in, fundamentally and the VS native function is no difference, we this way to develop, guarantees the universality, Plugins will not be discarded as a result of version migration



The most afraid of serious (Jane book author)
Original link: http://www.jianshu.com/p/894fb6a4e8e4
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

Visual Studio plug-in development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.