How to publish Visual Studio addins?

Source: Internet
Author: User
I helped a project to study the vs addins installation problem a few days ago. Problem Background: Use the vs2005 addin template to generate the myaddin1 project, complete addin compilation, and generate the myaddin1.dll and myaddin1.addin files for backup, we usually change the path in myaddin1.addin to the correct path in debug, and then copy it to % Documents % \ Visual Studio 2005 \ addins. This looks very simple, but what should we do on the customer's machine?
If we tell the customer that you want to install it like this-first copy the assembly to a certain place, and then copy The addin file to a certain place, the customer will definitely say that I won't, and then you will go about it, then the customer said that there was a problem and you had to continue to make the effort. In this case, it seems that the problem was solved, but one day, the customer installed an addin, which was unfortunate, the installation method of this Addin is also copied to % Documents % \ Visual Studio 2005 \ addins, and The addin file has the same name as yours (or other files have the same name as yours). Therefore, the phone is coming again ......
Obviously, this is too tired. Is there a good solution?
Yes. Before going through the solution, let's take a look at our addin goal-ide (vs2005 here) and open the Tools menu, here, you can open the option page. Under the Environment node, there is a plug-in/macro security. Then you can see that many directories are listed,

After checking the document, Ms said that IDE will search for plug-ins and macros according to the directory here. Haha, this is easy to do. If we put all the published files to a directory, then register the directory to the IDE search directory.
So, how to register? Ms stores these directories in the registry.

The Registry directories corresponding to some common versions are listed here:
Vs2005, x86: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ visualstudio \ 8.0\ Automationoptions \ lookinfolders
Vs2005, x64: HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432node\ Microsoft \ visualstudio \ 8.0\ Automationoptions \ lookinfolders
 
Vs2008, x86: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ visualstudio \ 9.0\ Automationoptions \ lookinfolders
Vs2008, x64: HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432node\ Microsoft \ visualstudio \ 9.0\ Automationoptions \ lookinfolders

PS: If addin can support multiple hosts (both vs2005 and vs2008 are supported )?
We only need to add the hostapplication node to support the corresponding ide. The following addin supports vs2005 and vs2008: 1 <? XML version = "1.0" encoding = "UTF-8" standalone = "no"?>
2 <extensibility xmlns = "http://schemas.microsoft.com/AutomationExtensibility">
3 4 <Name> Microsoft Visual Studio macros </Name>
5 <version> 9.0 </version>
6 7 8 <Name> Microsoft Visual Studio </Name>
9 <version> 9.0 </version>
10 11 12 <Name> Microsoft Visual Studio macros </Name>
<Version> 8.0 </version>
14 15 16 <Name> Microsoft Visual Studio </Name>
17 <version> 8.0 </version>
18 19 <addin>
20 <friendlyname> myaddin1 </friendlyname>
21 <description>
22 <aboutboxdetails> </aboutboxdetails>
23 <abouticondata> </abouticondata>
24 <Assembly> myaddin1.dll </Assembly>
25 <fullclassname> myaddin1.connect </fullclassname>
26 <loadbehavior> 1 </loadbehavior>
27 <commandpreload> 1 </commandpreload>
28 <commandlinesafe> 0 </commandlinesafe>
29 </addin>
30 </extensibility>

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.