Welcome to MSDN Blogs Sign in | Join | Help

Craig Skibo's WebLog

Sorry I can't answer the phone right now, I am outside feeding yogurt to the clowns.
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 http://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.

Posted: Thursday, May 03, 2007 2:13 PM by CraigSkibo

Comments

Andrei Ignat said:

It would not be better if you are thinking of codeplex instead of gotdotnet?

# May 6, 2007 6:43 PM

CraigSkibo said:

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.

# May 7, 2007 3:38 PM

Ankit Jain said:

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.

# May 29, 2007 1:01 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker