By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

clickOnce and Config file

P: n/a
hi,

After installing the application in the client machine using ClickOnce, i
would like that the client be able to change the
database path in the Application.Config file. However, clickonce does not
copy the Application.Config file when it deploys.

How can i be able to do it, Am i missing something in ClickOnce.

Thanks
Irfan


Apr 27 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
It probably does copy the Application.Config file (it's called app.config).
ClickOnce stuff gets installed under the user's Documents&Settings (XP)
folder somewhere, and it is obfuscated so he can't muck with it. The
app.config file is probably in there somewhere. The problem is, you can't
modify the information in the app.config file with code.

To get around this, I rolled my own settings stuff, with the default for
the ConnectionString hardcoded, and the user can modify it. I store it in
Environment.SpecialFolder.LocalApplicationData + "\myAppName". Then when
the app is upgraded to a new version, I don't lose my settings. This is
also the recommended location by Vista, so you don't have a problem with
Vista security either.

Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl...
hi,

After installing the application in the client machine using ClickOnce, i
would like that the client be able to change the
database path in the Application.Config file. However, clickonce does not
copy the Application.Config file when it deploys.

How can i be able to do it, Am i missing something in ClickOnce.

Thanks
Irfan


Apr 27 '07 #2

P: n/a
Rob,
Thanks for the reply.
I have another question:
How do u redirect the program to look at the ConnectionString of YOUR
config file instead the default config file.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fr******************************@comcast.com. ..
It probably does copy the Application.Config file (it's called
app.config). ClickOnce stuff gets installed under the user's
Documents&Settings (XP) folder somewhere, and it is obfuscated so he can't
muck with it. The app.config file is probably in there somewhere. The
problem is, you can't modify the information in the app.config file with
code.

To get around this, I rolled my own settings stuff, with the default for
the ConnectionString hardcoded, and the user can modify it. I store it in
Environment.SpecialFolder.LocalApplicationData + "\myAppName". Then when
the app is upgraded to a new version, I don't lose my settings. This is
also the recommended location by Vista, so you don't have a problem with
Vista security either.

Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl...
>hi,

After installing the application in the client machine using ClickOnce, i
would like that the client be able to change the
database path in the Application.Config file. However, clickonce does not
copy the Application.Config file when it deploys.

How can i be able to do it, Am i missing something in ClickOnce.

Thanks
Irfan



Apr 30 '07 #3

P: n/a
I don't used strongly typed datasets. I use stored procedures that load
DataSets, and my Data Access layer pulls the connection string from my
config file and uses it when opening the connection.

Are you using strongly typed datasets?

Robin S.
-----------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Rob,
Thanks for the reply.
I have another question:
How do u redirect the program to look at the ConnectionString of YOUR
config file instead the default config file.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fr******************************@comcast.com. ..
>It probably does copy the Application.Config file (it's called
app.config). ClickOnce stuff gets installed under the user's
Documents&Settings (XP) folder somewhere, and it is obfuscated so he
can't muck with it. The app.config file is probably in there somewhere.
The problem is, you can't modify the information in the app.config file
with code.

To get around this, I rolled my own settings stuff, with the default for
the ConnectionString hardcoded, and the user can modify it. I store it
in Environment.SpecialFolder.LocalApplicationData + "\myAppName". Then
when the app is upgraded to a new version, I don't lose my settings.
This is also the recommended location by Vista, so you don't have a
problem with Vista security either.

Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl...
>>hi,

After installing the application in the client machine using ClickOnce,
i would like that the client be able to change the
database path in the Application.Config file. However, clickonce does
not copy the Application.Config file when it deploys.

How can i be able to do it, Am i missing something in ClickOnce.

Thanks
Irfan




May 1 '07 #4

P: n/a
yes, I am using stongly typed datasets that creates a readonly
ConnectionString.
However, I deleted that ConnectionString and created a new Property in the
settings file with the SAME name.
This new property pulls the data from the XML file. What do you think about
it? Do you reckon it will
create any problems in future.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fp******************************@comcast.com. ..
>I don't used strongly typed datasets. I use stored procedures that load
DataSets, and my Data Access layer pulls the connection string from my
config file and uses it when opening the connection.

Are you using strongly typed datasets?

Robin S.
-----------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
>Rob,
Thanks for the reply.
I have another question:
How do u redirect the program to look at the ConnectionString of YOUR
config file instead the default config file.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fr******************************@comcast.com ...
>>It probably does copy the Application.Config file (it's called
app.config). ClickOnce stuff gets installed under the user's
Documents&Settings (XP) folder somewhere, and it is obfuscated so he
can't muck with it. The app.config file is probably in there somewhere.
The problem is, you can't modify the information in the app.config file
with code.

To get around this, I rolled my own settings stuff, with the default for
the ConnectionString hardcoded, and the user can modify it. I store it
in Environment.SpecialFolder.LocalApplicationData + "\myAppName". Then
when the app is upgraded to a new version, I don't lose my settings.
This is also the recommended location by Vista, so you don't have a
problem with Vista security either.

Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl...
hi,

After installing the application in the client machine using ClickOnce,
i would like that the client be able to change the
database path in the Application.Config file. However, clickonce does
not copy the Application.Config file when it deploys.

How can i be able to do it, Am i missing something in ClickOnce.

Thanks
Irfan




May 1 '07 #5

P: n/a
Well, if it works, that's great. You just have to remember if you recreate
the strongly typed dataset, to delete the ConnectionString again.

Robin S.
-----------------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
yes, I am using stongly typed datasets that creates a readonly
ConnectionString.
However, I deleted that ConnectionString and created a new Property in
the settings file with the SAME name.
This new property pulls the data from the XML file. What do you think
about it? Do you reckon it will
create any problems in future.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fp******************************@comcast.com. ..
>>I don't used strongly typed datasets. I use stored procedures that load
DataSets, and my Data Access layer pulls the connection string from my
config file and uses it when opening the connection.

Are you using strongly typed datasets?

Robin S.
-----------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
>>Rob,
Thanks for the reply.
I have another question:
How do u redirect the program to look at the ConnectionString of YOUR
config file instead the default config file.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fr******************************@comcast.co m...
It probably does copy the Application.Config file (it's called
app.config). ClickOnce stuff gets installed under the user's
Documents&Settings (XP) folder somewhere, and it is obfuscated so he
can't muck with it. The app.config file is probably in there
somewhere. The problem is, you can't modify the information in the
app.config file with code.

To get around this, I rolled my own settings stuff, with the default
for the ConnectionString hardcoded, and the user can modify it. I
store it in Environment.SpecialFolder.LocalApplicationData +
"\myAppName". Then when the app is upgraded to a new version, I don't
lose my settings. This is also the recommended location by Vista, so
you don't have a problem with Vista security either.

Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl...
hi,
>
After installing the application in the client machine using
ClickOnce, i would like that the client be able to change the
database path in the Application.Config file. However, clickonce does
not copy the Application.Config file when it deploys.
>
How can i be able to do it, Am i missing something in ClickOnce.
>
Thanks
Irfan
>
>
>
>




May 3 '07 #6

P: n/a
thanks again Rob

irfan
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:hd******************************@comcast.com. ..
Well, if it works, that's great. You just have to remember if you recreate
the strongly typed dataset, to delete the ConnectionString again.

Robin S.
-----------------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>yes, I am using stongly typed datasets that creates a readonly
ConnectionString.
However, I deleted that ConnectionString and created a new Property in
the settings file with the SAME name.
This new property pulls the data from the XML file. What do you think
about it? Do you reckon it will
create any problems in future.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fp******************************@comcast.com ...
>>>I don't used strongly typed datasets. I use stored procedures that load
DataSets, and my Data Access layer pulls the connection string from my
config file and uses it when opening the connection.

Are you using strongly typed datasets?

Robin S.
-----------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Rob,
Thanks for the reply.
I have another question:
How do u redirect the program to look at the ConnectionString of YOUR
config file instead the default config file.

irfan


"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Fr******************************@comcast.c om...
It probably does copy the Application.Config file (it's called
app.config). ClickOnce stuff gets installed under the user's
Documents&Settings (XP) folder somewhere, and it is obfuscated so he
can't muck with it. The app.config file is probably in there
somewhere. The problem is, you can't modify the information in the
app.config file with code.
>
To get around this, I rolled my own settings stuff, with the default
for the ConnectionString hardcoded, and the user can modify it. I
store it in Environment.SpecialFolder.LocalApplicationData +
"\myAppName". Then when the app is upgraded to a new version, I don't
lose my settings. This is also the recommended location by Vista, so
you don't have a problem with Vista security either.
>
Good luck.
Robin S.
--------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:Ov**************@TK2MSFTNGP05.phx.gbl.. .
>hi,
>>
>After installing the application in the client machine using
>ClickOnce, i would like that the client be able to change the
>database path in the Application.Config file. However, clickonce does
>not copy the Application.Config file when it deploys.
>>
>How can i be able to do it, Am i missing something in ClickOnce.
>>
>Thanks
>Irfan
>>
>>
>>
>>
>
>




May 3 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.