472,805 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

clickOnce and Config file

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
6 6765
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Danny Tuppeny | last post by:
I've been playing around with ClickOnce today, and it's all good stuff. Except, that if I change my application to NOT be full trust (which seems to make very little difference to the user prompt,...
1
by: M O J O | last post by:
Hi, I've have searched google, but can't find a solution to my problem. Om my develloper machine, I use one app.config, but when I deploy, I need to deploy another app.config. The reason...
2
by: Alex Bögli | last post by:
Hi I have a rather advanced deployment scenario and wanted to know, if anyone has an idea how to accomplish that with ClickOnce: We are deploying a 3-tier application with a client connecting...
3
by: Ronald S. Cook | last post by:
I have a Win app that references a class library project. Within the latter, there is a remoting.config file. When I publish my app using ClickOnce, it errors telling me it can't find the...
3
by: Peter Wyss | last post by:
Hello! I've a few questions about ClickOnce in VisualStudio 2005. The installation of my application works fine, I published the files on a webserver and installed the app on a winxp client,...
0
by: Sergio Montero | last post by:
Hi, I've been googling for a while trying to figure out how to solve this problem, pleasy, I'll appreciate any sugestions. I have a Winforms App that should work Online and Offline. Online...
0
by: Sergio Montero | last post by:
Hi, I've been googling for a while trying to figure out how to solve this problem, pleasy, I'll appreciate any sugestions. I have a Winforms App that should work Online and Offline. Online...
0
by: jonathonmc | last post by:
I have a winform app written in C# which accesses a web service using a dynamic URL (configured in the app.config). When I deploy this app via ClickOnce it builds the app.config into the manifest and...
3
by: =?Utf-8?B?QXZpc2hheSBCZW4tWnZp?= | last post by:
Hi, I have an application that I am encrypting the connection strings on the first run of the application. I am using clickonce to deploy the application, so this was a good solution as the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.