Deploying Visual Studio AddIn with shapefiles

345
2
08-26-2011 05:47 AM
AlexandraFairbarns
New Contributor III
Hi,

I am thinking of deploying my ArcGIS AddIn for Arc10. SO far I have been getting my files from my local disk drive. i dont want to deploy tthe addin and the data seperately - so is there a way to combine them? I was thinking of the resources section - but was unsure on how this operated - i know that i cannot add a geodatabase for example, or by addin another folder and stick the data in there.

Thank You to anyone who can help.

🙂 Alex
0 Kudos
2 Replies
AlexandraFairbarns
New Contributor III
OK, so i spent the entire day re-working my former theory. Rather than importing all the files i needed through the visual studio GUI, i copied everything from the original location on my c drive to the Resources folder automatically generated by VS in my new project add-in folder. Similarly, rather than put it in the Resources folder, I could have also used a new folder e.g. "data".

By adding these data files to the add-in folder, I can access any of the files statically. In my addin users can click on/off provided layers from a dockable window, similar to the TOC. If a user switches one on and it doesnt exist, it will add the file to the current view and the TOC. This involved .gdb, shapefiles and layers.

NB: Make sure that all you file sources point to the Resources (or new) folder where you are adding it from. I found that .gdb because windows stored it as a folder with files, i could certainly not go through the VS GUI, but add it manually. Dont worry if it doesnt show as openable.

I then add my layers etc programatically, getting the path name from the assembly directory.

Any more succinct thoughts on all of this/alternatives would be good.

Thank You

Alex
0 Kudos
MLowry
by
Occasional Contributor II
Hey Alex,

"In my addin users can click on/off provided layers from a dockable window, similar to the TOC. If a user switches one on and it doesnt exist, it will add the file to the current view and the TOC. This involved .gdb, shapefiles and layers."

Any way you could post some of your source code for this add-in? I want to create something similar for my use as well!

An alternative to deploying all of the data with the add-in is to use a network wide SDE server and then just have your users connect to that data instead of a local copy. This of course would only work if all of the add-in users have access to your SDE database, though.
0 Kudos