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 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.