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/building-clickonce-applications-from-the-command-line.md
+48-7Lines changed: 48 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,11 @@ ms.workload:
20
20
- "multiple"
21
21
---
22
22
# Build ClickOnce applications from the command line
23
+
23
24
In [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)], you can build projects from the command line, even if they are created in the integrated development environment (IDE). In fact, you can rebuild a project created with [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] on another computer that has only the .NET Framework installed. This allows you to reproduce a build using an automated process, for example, in a central build lab or using advanced scripting techniques beyond the scope of building the project itself.
24
25
25
-
## Use MSBuild to reproduce ClickOnce application deployments
26
+
## Use MSBuild to reproduce .NET Framework ClickOnce application deployments
27
+
26
28
When you invoke msbuild /target:publish at the command line, it tells the MSBuild system to build the project and create a [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application in the publish folder. This is equivalent to selecting the **Publish** command in the IDE.
27
29
28
30
This command executes *msbuild.exe*, which is on the path in the Visual Studio command-prompt environment.
@@ -35,7 +37,7 @@ In [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)]
35
37
36
38
## Create and build a basic ClickOnce application with MSBuild
37
39
38
-
####To create and publish a ClickOnce project
40
+
### To create and publish a ClickOnce project
39
41
40
42
1. Open Visual Studio and create a new project.
41
43
@@ -70,12 +72,26 @@ In [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)]
70
72
5. Type `msbuild /target:publish`.
71
73
72
74
The above steps will produce a full [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application deployment in a subfolder of your project named **Publish**. *CmdLineDemo.application* is the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] deployment manifest. The folder *CmdLineDemo_1.0.0.0* contains the files *CmdLineDemo.exe* and *CmdLineDemo.exe.manifest*, the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application manifest. *Setup.exe* is the bootstrapper, which by default is configured to install the .NET Framework. The DotNetFX folder contains the redistributables for the .NET Framework. This is the entire set of files you need to deploy your application over the Web or via UNC or CD/DVD.
73
-
75
+
74
76
> [!NOTE]
75
77
> The MSBuild system uses the **PublishDir** option to specify the location for output, for example `msbuild /t:publish /p:PublishDir="<specific location>"`.
76
78
79
+
::: moniker range=">=vs-2019"
80
+
81
+
## Build .NET ClickOnce applications from the command line
82
+
83
+
Building .NET ClickOnce applications from the command line is a similar experience except, you need to provide an additional property for the publish profile on the MSBuild command line. The easiest way to create a publish profile is by using Visual Studio. See [Deploy a .NET Windows application using ClickOnce](quickstart-deploy-using-clickonce-folder.md) for more information.
84
+
85
+
Once you have the publish profile created, you can provide the pubxml file as a property on the msbuild command line. For example:
When you publish the application in the above procedures, the following properties are inserted into your project file by the Publish Wizard. These properties directly influence how the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application is produced.
93
+
94
+
When you publish the application in the above procedures, the following properties are inserted into your project file by the Publish Wizard or in the publish profile file for .NET Core 3.1, or later projects. These properties directly influence how the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application is produced.
79
95
80
96
In *CmdLineDemo.vbproj* / *CmdLineDemo.csproj*:
81
97
@@ -99,21 +115,36 @@ In [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)]
99
115
<BootstrapperEnabled>true</BootstrapperEnabled>
100
116
```
101
117
102
-
You can override any of these properties at the command line without altering the project file itself. For example, the following will build the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application deployment without the bootstrapper:
118
+
For .NET Framework projects, you can override any of these properties at the command line without altering the project file itself. For example, the following will build the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application deployment without the bootstrapper:
For .NET Core 3.1, or later, projects these settings are provided in the pubxml file.
107
126
108
127
Publishing properties are controlled in [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] from the **Publish**, **Security**, and **Signing** property pages of the **Project Designer**. Below is a description of the publishing properties, along with an indication of how each is set in the various property pages of the application designer:
109
128
129
+
> [!NOTE]
130
+
> For .NET Windows desktop projects, these settings are now found in the Publish Wizard
131
+
::: moniker-end
132
+
110
133
-`AssemblyOriginatorKeyFile` determines the key file used to sign your [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application manifests. This same key may also be used to assign a strong name to your assemblies. This property is set on the **Signing** page of the **Project Designer**.
134
+
::: moniker range=">=vs-2019"
135
+
For .NET windows applications, this setting remains in the project file
136
+
::: moniker-end
111
137
112
138
The following properties are set on the **Security** page:
113
139
114
140
-**Enable ClickOnce Security Settings** determines whether [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] manifests are generated. When a project is initially created, [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] manifest generation is off by default. The wizard will automatically turn this flag on when you publish for the first time.
115
141
116
142
-**TargetZone** determines the level of trust to be emitted into your [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application manifest. Possible values are "Internet", "LocalIntranet", and "Custom". Internet and LocalIntranet will cause a default permission set to be emitted into your [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application manifest. LocalIntranet is the default, and it basically means full trust. Custom specifies that only the permissions explicitly specified in the base *app.manifest* file are to be emitted into the [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] application manifest. The *app.manifest* file is a partial manifest file that contains just the trust information definitions. It is a hidden file, automatically added to your project when you configure permissions on the **Security** page.
143
+
-
144
+
::: moniker range=">=vs-2019"
145
+
> [!NOTE]
146
+
> For .NET Core 3.1, or later, Windows desktop projects, these Security settings are not supported.
147
+
::: moniker-end
117
148
118
149
The following properties are set on the **Publish** page:
-`UpdateEnabled` indicates whether the application should check for updates.
135
166
136
167
-`UpdateMode` specifies either Foreground updates or Background updates.
137
-
168
+
::: moniker range=">=vs-2019"
169
+
For .NET Core 3.1, or later, projects, Background is not supported.
170
+
::: moniker-end
138
171
-`UpdateInterval` specifies how frequently the application should check for updates.
172
+
::: moniker range=">=vs-2019"
173
+
For .NET Core 3.1, or later, this setting is not supported.
174
+
::: moniker-end
139
175
140
176
-`UpdateIntervalUnits` specifies whether the `UpdateInterval` value is in units of hours, days, or weeks.
177
+
::: moniker range=">=vs-2019"
178
+
For .NET Core 3.1, or later, this setting is not supported.
179
+
::: moniker-end
141
180
142
181
-`UpdateUrl` (not shown) is the location from which the application will receive updates. If specified, this value is inserted into the application manifest.
|`UpdateURL`|Optional. Set this URL option if the update location is different than the `InstallURL`. For example, you could set the `PublishURL` to an FTP path and set the `UpdateURL` to a Web URL.|
Copy file name to clipboardExpand all lines: docs/deployment/choosing-a-clickonce-update-strategy.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,8 @@ ms.workload:
67
67
</update>
68
68
</subscription>
69
69
```
70
+
> [!NOTE]
71
+
> For .NET 3.1 and newer applications, checking updates before the application starts is the only update option supported.
70
72
71
73
## Make updates required
72
74
There may be occasions when you want to require users to run an updated version of your application. For example, you might make a change to an external resource such as a Web service that would prevent the earlier version of your application from working correctly. In this case, you would want to mark your update as required and prevent users from running the earlier version.
@@ -113,7 +115,7 @@ ms.workload:
113
115
No prompting for trust levels will occur if you use Trusted Application Deployment. For more information, see [Trusted application deployment overview](../deployment/trusted-application-deployment-overview.md).
114
116
115
117
## See also
116
-
\<xref:System.Deployment.Application>
118
+
-<xref:System.Deployment.Application>
117
119
-[ClickOnce security and deployment](../deployment/clickonce-security-and-deployment.md)
118
120
-[Choose a ClickOnce deployment strategy](../deployment/choosing-a-clickonce-deployment-strategy.md)
0 commit comments