Search code examples
c#-4.0vstoclickonceword-2007

how do I mark a file as a data file in a visual studio 2010 vsto clickonce application?


I'm making a Word 2007 add-in with C# 4.0 in Visual Studio 2010. I need an Access 2007 database (a .accdb file) to be placed in the data directory by the clickonce installer. Unfortunately, the file is getting put elsewhere, so the application can't find it at runtime. I've seen various articles refer to using the Application Files dialog on the Publish tab of the project properties to mark the file as a data file, but I have no Application Files button for some reason.

Any idea how to make the Application Files dialog appear, or some other way to manually mark my .accdb file as a data file?


Solution

  • I was able to get things to work by using the Mage tool as described here:

    http://msdn.microsoft.com/en-us/library/6fehc36e.aspx

    The trick with MageUI is it's open file dialog assumes you want to open a manifest associated with a .exe; a vsto project has a .dll, so the manifest doesn't appear in the files list by default, which was really tripping me up.

    Basically, this process is a pain because you have to remember to do it manually. I don't know if there's a way to make this part of the build (maybe a post-build step? But this is really a post-publish step).