I creating an addin for ArcMap - but my code needs to read from an xml file to generate a dynamic form - I have put the form in the AppData folder as I don't think I can read from an xml file wrapped up in the addin.

So how do you deploy the xml file automatically to the appdata folder when you deploy the addin for users to use?


1 Answer 1


You can't "deploy" a file to an arbitrary location during the add-in installation, but you can certainly create the file at some point during your add-in's initialization or some other execution time.

You could include a "default" XML file within your add-in that you copy to the user's AppData folder at said time, or generate the file from scratch the first time the user "saves" whatever configuration information you are implementing.

If you want to reference a "default" config file, you can locate files extracted alongside your add-in assembly at runtime with something like this:

var pathToDefaultConfigFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MyDefaultConfigFile.xml");
  • That's been a great help for me - thanks very much :)
    – Vidar
    Mar 11, 2014 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.