Home All Groups Group Topic Archive Search About

ClickOnce Deployment and the ConfigurationSection

Author
19 Oct 2006 9:16 PM
SR
I have created an application that stores my configuration settings using
the ConfigurationSection, ConfigurationElements, and
ConfigurationElementCollection.  Due to the complexity of my configuration
(hence the collection piece) I did not try using the settings API.  I have
now gotten to the point where I need to worry about deployment and updates.
ClickOnce deployment works great except for the fact that everytime my
application gets updated, the settings will get lost.

Is there a way to use ConfigurationSection along with ClickOnce and get the
settings transferred on an update?  Or do I need to investigate another
method of updating or store my settings in another manner?

TIA

Seth

Author
20 Oct 2006 12:25 PM
Fabio Cozzolino
Hello SR,

> Is there a way to use ConfigurationSection along with ClickOnce and
> get the settings transferred on an update?  Or do I need to
> investigate another method of updating or store my settings in another
> manner?
>

try to use the ApplicationSettingsBase.Update() method (http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.upgrade.aspx)
to upgrade your settings. You can check the ApplicationDeployment.IsFirstRun
property (http://msdn2.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.isfirstrun.aspx)
and then execute ApplicationSettingsBase.Update():

if (ApplicationDeployment.CurrentDeployment.IsFirstRun)
{
    ApplicationSettingsBase.Update();
}

> TIA
>
> Seth
>

HTH
------
Fabio Cozzolino
Microsoft MCAD.NET
DotNetSide Community Manager
Blog: http://dotnetside.org/blogs/fabio

Workshop ".NET Present & Future" - Bari, 26 Ottobre 2006
Author
20 Oct 2006 6:09 PM
SR
Thank you for the response Fabio.

I have seen these articles before but a question still remains.  Where do I
apply this?

Thanks,

Seth

<Fabio Cozzolino> wrote in message
Show quote
news:503cdce5415f8c8c26acbb49339@news.microsoft.com...
> Hello SR,
>
>> Is there a way to use ConfigurationSection along with ClickOnce and
>> get the settings transferred on an update?  Or do I need to
>> investigate another method of updating or store my settings in another
>> manner?
>>
>
> try to use the ApplicationSettingsBase.Update() method
> (http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.upgrade.aspx)
> to upgrade your settings. You can check the
> ApplicationDeployment.IsFirstRun property
> (http://msdn2.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.isfirstrun.aspx)
> and then execute ApplicationSettingsBase.Update():
>
> if (ApplicationDeployment.CurrentDeployment.IsFirstRun)
> {
>    ApplicationSettingsBase.Update();
> }
>
>> TIA
>>
>> Seth
>>
>
> HTH
> ------
> Fabio Cozzolino
> Microsoft MCAD.NET
> DotNetSide Community Manager
> Blog: http://dotnetside.org/blogs/fabio
>
> Workshop ".NET Present & Future" - Bari, 26 Ottobre 2006
>
>
Author
23 Oct 2006 9:20 AM
Fabio Cozzolino
Hello SR,

> Thank you for the response Fabio.
>
> I have seen these articles before but a question still remains.  Where
> do I apply this?
>
> Thanks,
>
> Seth
>

Hi SR,
sorry for my bad response. When you install a new version of your application
with ClickOnce, ApplicationSettingsBase automatically upgrade settings for
you at the point settings are loaded. It is very strange that doesn't work
for you. Is your application deployed as Online or Online/Offline?

------
Fabio Cozzolino
Microsoft MCAD.NET
DotNetSide Community Manager
Blog: http://dotnetside.org/blogs/fabio

Workshop ".NET Present & Future" - Bari, 26 Ottobre 2006
Author
23 Oct 2006 4:15 PM
SR
It is online.

Does it have anything to do with the fact that I have custom configuration
settings using the System.Configuration methods and objects?

Seth


<Fabio Cozzolino> wrote in message
Show quote
news:503cdce54afb8c8c4ac50bdf305@news.microsoft.com...
> Hello SR,
>
>> Thank you for the response Fabio.
>>
>> I have seen these articles before but a question still remains.  Where
>> do I apply this?
>>
>> Thanks,
>>
>> Seth
>>
>
> Hi SR,
> sorry for my bad response. When you install a new version of your
> application with ClickOnce, ApplicationSettingsBase automatically upgrade
> settings for you at the point settings are loaded. It is very strange that
> doesn't work for you. Is your application deployed as Online or
> Online/Offline?
>
> ------
> Fabio Cozzolino
> Microsoft MCAD.NET
> DotNetSide Community Manager
> Blog: http://dotnetside.org/blogs/fabio
>
> Workshop ".NET Present & Future" - Bari, 26 Ottobre 2006
>
>
Author
24 Oct 2006 7:54 AM
Fabio Cozzolino
Ciao SR,

> It is online.
>
> Does it have anything to do with the fact that I have custom
> configuration settings using the System.Configuration methods and
> objects?

I don't think. You consider that with the online deploy, your application
is not installed on client. This mean that no files are copied on client
machine. Therefor you lose changes at your local settings when shut down
your application.

There is no way to change this. In my opinion, you can only deploy with online/offline
capabilities.

HTH
------
Fabio Cozzolino
Microsoft MCAD.NET
DotNetSide Community Manager
Blog: http://dotnetside.org/blogs/fabio

Workshop ".NET Present & Future" - Bari, 26 Ottobre 2006

AddThis Social Bookmark Button