Project config file.

Add-in Express™ Support Service
That's what is more important than anything else

Project config file.
 
Wyatt Albiston


Guest


If I had a config file for my project to access our database, where would I put it so that the add-in could use it to do the same?

I've tried copying it to the Office 11 folder and the add-in projects bin folder.
Posted 27 Apr, 2006 11:39:16 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Wyatt.

I would put it to the add-in installation folder. To get the installation path you can use the Assembly.GetExecutingAssembly().Location property.
Posted 27 Apr, 2006 12:34:14 Top
Wyatt Albiston


Guest


I have done so. The current installation folder is my Bin folder. I have placed the config file in that folder.

I have been searching for an answer elsewhere and have found that the .dll will get its config settings from the calling exes config file. In the case of the add-in what would the calling exe be? My app does not call it directly, it only opens word and from there the add-in does its work. I do reference a .dll in my app that holds business objects and such. I attempt to call methods in my .dll but get an index out of range error do to the fact that it cannot access the database. The connection string is in the config file that the add-in seems to not have access to.

Any other suggestions?
Posted 27 Apr, 2006 16:34:26 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Wyatt.

You can use the config file of the exe application. But in any case you will have to open it manually in the code of the add-in.
You can use the XmlTextReader class to look through all elements in the config.
Posted 29 Apr, 2006 09:05:07 Top