I'm attempting to automate signing of an ArcGIS Add-In using a post build event in visual studio that triggers a batch file (which subsequently triggers ESRISignAddIn utility). Running the batch file manually through command prompt works fine, the Add-In is signed successfully. However if I attempt to run the batch file in the post-build event, it returns an error saying the Add-In file cannot be found. I've noticed that by the time the build process gets to the post-build stage, only the DLLs are created - the Add-In file is not, hence the batch file cannot find it. It appears the Add-In file is created AFTER the post-build event (illogical, I know).
I have tried adding the batch commands to the post-build event command line (in project settings > compile > build events), and have also tried adding this directly to the project file XML:
<Target Name="AfterBuild"> <Exec Command=""$(ProjectDir)Post_Build.bat" "$(TargetDir)my.esriAddIn"" /> </Target>
Seems that 'post build' and 'after build' events are both executed before the esriaddin file is built, useless!
Has anyone had any experience working with post-build events and ArcGIS Add-Ins? I want to know if it's possible to force the Add-In file (my.esriaddin) to be created before the post-build event.
My last resort solution is to execute the build and then the batch file using a build runner (e.g. finalbuilder), but would ideally like to keep everything in the same project.