Skip to content

Commit 6b58021

Browse files
authored
Merge pull request #13804 from ghogen/msbuild-errors-april-2025-2
Two MSBuild errors relating to ClickOnce and manifests
2 parents 67eafa1 + 21ea0bd commit 6b58021

File tree

3 files changed

+40
-16
lines changed

3 files changed

+40
-16
lines changed
Loading

docs/msbuild/errors/msb3176.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "MSB3176 diagnostic code"
3-
description: "Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the current publish version."
4-
ms.date: 12/06/2024
3+
description: Learn about the possible causes of the MSBuild MSB3176 error, and get troubleshooting tips.
4+
ms.date: 4/7/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3176
@@ -26,14 +26,29 @@ This article describes the MSB3176 error code.
2626

2727
## Message text
2828

29-
```output
30-
MSB3176: Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the current publish version.
31-
```
29+
`MSB3176: Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the current publish version.`
3230

3331
<!-- :::editable-content name="postOutputDescription"::: -->
34-
<!--
35-
{StrBegin="MSB3176: "}
36-
-->
32+
## Description
33+
34+
This error refers to the minimum required version property you specified for the ClickOnce manifest. See [Choose a ClickOnce update strategy - make updates required](../../deployment/choosing-a-clickonce-update-strategy.md#make-updates-required).
35+
36+
This error occurs when the version you specified as the minimum required version is greater than the current version you're building.
37+
38+
## Resolution
39+
40+
Check the minimum required version property and change it so that it is less than or equal to the current version. If a user has a version below this version, they are required to update at least to the minimum required version. The minimum version requirement is optional. If you don't want to require a minimum version, you can turn off this setting.
41+
42+
For .NET applications, in the Visual Studio **Publish** tool, you can change the minimum required version setting by choosing the **Update settings** link on the **Settings** screen.
43+
44+
:::image type="content" source="./media/msb3176/update-settings.png" alt-text="Screenshot showing the Application Settings screen in Visual Studio, reached from the Update Settings link on the Settings page in the Publish wizard." :::
45+
46+
For .NET Framework, Open the Project Properties (**Alt**+**Enter**) and navigate to the **Publish** property page, then select **Updates** to specify the minimum required version.
47+
48+
Or, in the [deployment manifest](../../deployment/deployment-element-clickonce-deployment.md), you can find this property as an attribute of the `deployment` element:
49+
50+
`<deployment install="true" minimumRequiredVersion="1.0.0.0">`
51+
3752
<!-- :::editable-content-end::: -->
3853
<!-- :::ErrorDefinitionDescription-end::: -->
3954

docs/msbuild/errors/msb3321.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "MSB3321 diagnostic code"
3-
description: "Importing key file 'value' was canceled."
4-
ms.date: 12/06/2024
3+
description: Learn about the possible causes of MSBuild error MSB3321 and get troubleshooting tips.
4+
ms.date: 4/7/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3321
@@ -26,14 +26,23 @@ This article describes the MSB3321 error code.
2626

2727
## Message text
2828

29-
```output
30-
MSB3321: Importing key file 'value' was canceled.
31-
```
29+
`MSB3321: Importing key file 'filename' was canceled.`
3230

3331
<!-- :::editable-content name="postOutputDescription"::: -->
34-
<!--
35-
{StrBegin="MSB3321: "}
36-
-->
32+
## Description
33+
34+
This error occurs when MSBuild tries to sign a ClickOnce assembly manifest with an Authenticode certificate, but fails to import the private key from the given key file.
35+
36+
During the ClickOnce deployment process, or when running the `Publish` target in MSBuild, an assembly is signed with a strong name Authenticode certificate, either a temporary "devtest" certificate, which you typically use during development, or a trusted certificate issued by a Certificate Authority (CA). The scenario is described at [Build a ClickOnce application from the command line](../../deployment/building-clickonce-applications-from-the-command-line.md).
37+
38+
In order to use a certificate with a private key in a `.pfx` file, it needs to be verified with a password so the certificate is trusted; it can then be used by MSBuild. When you build and sign a manifest with Visual Studio, you provide the password in Visual Studio when you specify the key filename. However, when you build the same project on another machine, such as a build server, without installing or using Visual Studio, the key must be added to the build server's store of trusted certificates, and verified with the password. After that, it's available to MSBuild to sign a ClickOnce assembly.
39+
40+
## Resolution
41+
42+
If you are building on a machine without Visual Studio installed, such as when setting up a build server, add the Authenticode certificate and private key to the Windows [Trusted Publishers Certificate Store](/windows-hardware/drivers/install/trusted-publishers-certificate-store). You can use [certmgr](/windows-hardware/drivers/devtest/certmgr) to add a certificate to the system store. Once added, it is available to MSBuild when trying to sign an assembly until the certificate expires or is removed.
43+
44+
You can also use *dotnet-mage.exe* for .NET projects, or *mage.exe* (Manifest Assembly Generation) for .NET Framework projects to generate and sign ClickOnce manifests. See [Manually deploy a ClickOnce application](../../deployment/walkthrough-manually-deploying-a-clickonce-application.md).
45+
3746
<!-- :::editable-content-end::: -->
3847
<!-- :::ErrorDefinitionDescription-end::: -->
3948

0 commit comments

Comments
 (0)