Hi - yes I could insert a key value pair which pointed to the location.
However I am building framework software, which is utilizing the application
config file to contain a deployment descriptor. From this deployment
descriptor I need to point to another file, which is usually located
relative to the application config file.
Since I would very much like to offer a "path-independent" format of the
descriptor, so that the user can just move to another path and still have
the refenrece to this other file working.
Cheers
Thomas
"William Ryan" <do********@comcast.nospam.net> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
ConfigurationSettings.AppSettings.Item("connectStr ing").ToString) - Will
get you
This value in the Config file
<appSettings>
<add key="connectString" value="packet size=4096;integrated
security=SSPI;data source=-----SQLSRV;persist security info=False;initial
catalog=-----" />
<add key="url" value="http://www.inf-------.com" />
</appSettings>
"Thomas Koch" <th********@yahoo.dk> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl... Hi - I would like to load other files relative to the application config
file.
Do anyone know if this is possible?
If I do Environment.CurrentDirectory it will work if the program is
launched directly from there. Another approach is to combine CurrentDirectory
with the CommandLine string in order to locate the startup assembly, and thus
the directory of the application config file.
It all seems very clumsy to me and I am not even sure that'll work very
well in an ASP.NET application.
I wonder if anyone knows of a better technique.
Cheers
Thomas Koch