更新时间:2021-12-07 08:31:21
迄今为止为行为改变找到了解决方案。 Leandro Taset 在对原始问题的评论:
This post contains the best solution found so far for the change in behavior. The solution was suggested by Leandro Taset in a comment to the original question:
对于需要代码签名的项目,请打开其关联的 .csproj
文件。您应该能够在该文件中列出的 PropertyGroup
节点内找到一个 SignManifests
节点,如下所示:
For the project which requires code signing, open its associated .csproj
file. You should be able to find a SignManifests
node inside of a PropertyGroup
node listed in that file listed as follows:
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
此属性同时显示在VS2010和VS2013项目文件中,并在项目范围内列出。您应该能够找到两个与以下内容相似的 Property Group
节点:
This property shows up in both the VS2010 and VS2013 project files and is listed at the project scope. You should be able to find two different Property Group
nodes that look similar to the following:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<!-- There may be several properties already in the PropertyGroup node -->
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<!-- There may be several properties already in the PropertyGroup node -->
</PropertyGroup>
这些 PropertyGroup
节点定义了以下项目属性:
These PropertyGroup
nodes define project properties which are conditionally applied based on the current configuration and platform being targeted when you build the project.
您将需要删除 SignManifests $ c,并根据当前配置和目标平台有条件地应用此工具。您首先找到的$ c>节点,并将新的
SignManifests
节点放置在每个有条件的 PropertyGroup
节点中:
You'll want to remove the SignManifests
node you first found and place a new SignManifests
node in each of the conditional PropertyGroup
nodes:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<!-- -->
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<!-- -->
<SignManifests>true</SignManifests>
</PropertyGroup>
这将使VS2013表现得更好。在发布版本期间(在示例中,发布版本目标为 AnyCPU
),VS2013将尝试对清单进行签名,而在Debug模式下则不会。
This will cause VS2013 to behave a little better. During Release builds (well, in the example Release builds targeting AnyCPU
) VS2013 will attempt to sign the manifest and in Debug modes it will not.
此解决方案有几点警告:
A couple caveats to this solution:
Project
级别的 SignManifests
节点,而无需附加任何条件回到我们开始的地方。在其他选项卡中更改项目设置不会显示在该节点上,因此您可以随意在其他位置进行所需的项目属性更改。SignManifests
node at the Project
level without any conditionals on it putting us back where we started. Changing project settings in other tabs doesn't appear re-add the node, so you're free to make needed project property changes elsewhere.