You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deployment/clickonce-and-application-settings.md
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
---
2
2
title: "ClickOnce and Application Settings | Microsoft Docs"
3
3
description: Learn how application settings files work in a ClickOnce application and how ClickOnce migrates settings when the user upgrades to the next version.
4
-
ms.custom: SEO-VS-2020
5
-
ms.date: "11/04/2016"
4
+
ms.date: "08/03/2022"
6
5
ms.topic: "conceptual"
7
6
dev_langs:
8
7
- "VB"
@@ -26,6 +25,7 @@ Application settings for Windows Forms makes it easy to create, store, and maint
26
25
The information below applies only to the default application settings provider, the <xref:System.Configuration.LocalFileSettingsProvider> class. If you supply a custom provider, that provider will determine how it stores its data and how it upgrades its settings between versions. For more information on application settings providers, see [Application settings architecture](/dotnet/framework/winforms/advanced/application-settings-architecture).
27
26
28
27
## Application settings files
28
+
29
29
Application settings consumes two files: *\<app>.exe.config* and *user.config*, where *app* is the name of your Windows Forms application. *user.config* is created on the client the first time your application stores user-scoped settings. *\<app>.exe.config*, by contrast, will exist prior to deployment if you define default values for settings. Visual Studio will include this file automatically when you use its **Publish** command. If you create your ClickOnce application using *Mage.exe* or *MageUI.exe*, you must make sure this file is included with your application's other files when you populate your application manifest.
30
30
31
31
In a Windows Forms application not deployed using ClickOnce, an application's *\<app>.exe.config* file is stored in the application directory, while the *user.config* file is stored in the user's **Documents and Settings** folder. In a ClickOnce application, *\<app>.exe.config* lives in the application directory inside of the ClickOnce application cache, and *user.config* lives in the ClickOnce data directory for that application.
@@ -34,7 +34,12 @@ Application settings for Windows Forms makes it easy to create, store, and maint
34
34
35
35
In a ClickOnce application, the size of the configuration files used by application settings is constrained by the size of the ClickOnce cache. For more information, see [ClickOnce cache overview](../deployment/clickonce-cache-overview.md).
36
36
37
+
## .NET Core and .NET 5+
38
+
39
+
Currently, a .NET Core assembly to be published needs to be signed with a strong name key file. If it isn't, `ApplicationSettingsBase.Upgrade` method does not copy settings correctly after a new ClickOnce publish. You can specify use of a strong name in the .NET Core project's properties, under the **Build > Strong naming** option.
40
+
37
41
## Version upgrades
42
+
38
43
Just as each version of a ClickOnce application is isolated from all other versions, the application settings for a ClickOnce application are isolated from the settings for other versions as well. When your user upgrades to a later version of your application, application settings compares most recent (highest-numbered) version's settings against the settings supplied with the updated version and merges the settings into a new set of settings files.
39
44
40
45
The following table describes how application settings decides which settings to copy.
@@ -49,9 +54,11 @@ Application settings for Windows Forms makes it easy to create, store, and maint
49
54
If you have created your own application settings wrapper class and wish to customize the update logic, you can override the <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> method.
50
55
51
56
## ClickOnce and roaming settings
57
+
52
58
ClickOnce does not work with roaming settings, which allows your settings file to follow you across machines on a network. If you need roaming settings, you will need either to implement an application settings provider that stores settings over the network, or develop your own custom settings classes for storing settings on a remote computer. For more information in settings providers, see [Application settings architecture](/dotnet/framework/winforms/advanced/application-settings-architecture).
53
59
54
60
## See also
61
+
55
62
-[ClickOnce security and deployment](../deployment/clickonce-security-and-deployment.md)
0 commit comments