次の方法で共有


Making Add-in development easier

One complaint that we have received about creating Add-ins is about the .addin file. Specifically, why are there two of them? If you move the project file, check into source code control, etc. then the file no longer works or disappears. To make this easier I wrote a small tool found at https://workspaces.gotdotnet.com/VSExtTools under the name .addin Helper. When added as a build rule, it will open the .addin file, modify the path to point to the just built DLL, then save it under the My Documents\Visual Studio 2005\Addins directory.

To use the file, save it into your install directory (C:\Program Files\Microsoft Visual Studio 8\Common7\IDE) then add this as your build rule for C# or J#:

"$(DevEnvDir)AddinHelper.exe" "-XmlFile:$(ProjectDir)$(ProjectName).AddIn" "-Assembly:$(TargetDir)$(TargetFileName)" -q

 For VB, you will need to modify the project file. Find the <PostBuildEvent></PostBuildEvent> tag, and change it to:

<PostBuildEvent>"$(DevEnvDir)AddinHelper.exe" "-XmlFile:$(ProjectDir)$(ProjectName).AddIn" "-Assembly:$(TargetDir)$(TargetFileName)" -q</PostBuildEvent>

For C++/CLR projects, use this command line (be sure to set it for both Debug and Release configurations):

"$(VSInstallDir)Common7\IDE\AddinHelper.exe" "-XmlFile:$(ProjectDir)$(ProjectName).AddIn" "-Assembly:$(TargetDir)$(TargetFileName)" -q

Now, as long as all users of your project has the AddinHelper.exe tool in the correct location, the .addin file will be updated with the correct path to the .dll.

Comments

  • Anonymous
    May 06, 2007
    It would not be better if you are thinking of codeplex instead of gotdotnet?

  • Anonymous
    May 07, 2007
    Andrei, we are looking into new places to host content like this. Until we find one (there are reasons why we cannot use CodePlex) I will be posting this on GDN.

  • Anonymous
    May 29, 2007
    Hi Craig, Even i have faced the same problem and the solution is to keep both .addin file and the assembly(dll) inside 'My Documents' folder and deploy it using an installer.