ClickOnce 应用程序自动禁用调试版本签名

问题描述 投票:0回答:1

我使用的是VS2022。我正在使用 DigiCert 证书来签署 ClickOnce 清单。当我构建一个版本时,我必须输入 PIN。我想在调试时避免这种情况。现在,我必须在调试时手动取消选中“签署 ClickOnce 清单”,然后记得在发布之前重新检查它。

我发现这个旧线程建议我可以向 vbproj 添加一个条件,以自动不签署调试版本,但自动签署发布版本。这似乎并没有完全满足我的要求。这是旧线程:如何在 Visual Studio 2013 中禁用调试版本的代码签名?

这是我放入 vbproj 中的内容:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <!--  -->
    <SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <!--  -->
    <SignManifests>true</SignManifests>
</PropertyGroup>

你知道我还需要对 vbproj 做什么吗?

vb.net visual-studio clickonce code-signing
1个回答
0
投票

您可以向与签名相关的属性添加条件,以仅在不处于调试配置时应用。

<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
    <ManifestCertificateThumbprint>...</ManifestCertificateThumbprint>
    <ManifestKeyFile>...</ManifestKeyFile>
    <ManifestKeyPassword>...</ManifestKeyPassword>
    ...
</PropertyGroup>
© www.soinside.com 2019 - 2024. All rights reserved.