0

我的解决方案中的 11 个 DLL 必须使用 PFX 证书(使用 Click-Once 安装的大型企业应用程序)。证书完美运行,除非每次有人从不同的开发人员/工作站拉下 TFS 分支时,证书密码无效并且他们收到:

错误无法导入以下密钥文件:CertificateName.pfx。密钥文件可能受密码保护。要更正此问题,请尝试再次导入证书或手动将证书安装到具有以下密钥容器名称的强名称 CSP:VS_KEY_DB583A44F66CCF4B AssemblyName

强制他们为所有 11 个程序集重新输入相同的密码[下图]。这个非常耗时的繁琐的解决方案/修复是什么?

在此处输入图像描述

我知道从不同的工作站输入相同的密码会使用本地值在技术上产生不同的密钥,但我确信我不是第一个遇到这个问题的人。

4

1 回答 1

0

这通过阻止 .pfx 文件被签入并从 TFS 中删除来解决。出现了三种潜在的解决方案:

  1. 使用服务器 TFS Power Tools 的禁止模式策略。

    stackoverflow.com/questions/2741412/forbidden-patterns-check-in-policy-in-tfs-2010

    msdn.microsoft.com/en-us/library/gg475890%28v=vs.100%29.aspx

  2. TFS '伪装'

    stackoverflow.com/questions/29808807/how-to-cloak-directories-in-tfs-command-line

    MSDN - TFS 中的伪装

  3. .tfignore (选择的解决方案)

    AIS 博客 - 从团队基金会版本控制使用 tfignore 文件排除文件

最后,我发现 .tfignore 是最好的解决方案。.tfignore 是通过在 Pending Changes 页面的 Excluded 部分中选择“Detected changes link”自动生成的,然后从 PFX 文件的快捷菜单中选择Ignore by extension (*.pfx)。

.tfignore 被引入映射工作空间的根目录,因此该规则将在下一次从 TFS 拉取时立即应用于每个开发人员的工作空间。

    ################################################################################
# This .tfignore file was automatically created by Microsoft(R) Visual Studio.
#
# Local items matching filespecs in this file will not be added to version
# control. This file can be checked in to share exclusions with others.
#
# Wildcard characters are * and ?. Patterns are matched recursively unless the
# pattern is prefixed by the \ character.
#
# You can prepend a path to a pattern to make it more specific. If you do,
# wildcard characters are not permitted in the path portion.
#
# The # character at the beginning of a line indicates a comment.
#
# The ! prefix negates a pattern. This can be used to re-include an item after
# it was excluded by a .tfignore file higher in the tree, or by the Team
# Project Collection's global exclusions list.
#
# The / character is interpreted as a \ character on Windows platforms.
#
# Examples:
#
#  # Excludes all files ending in .txt in Alpha\Beta and all its subfolders.
#  Alpha\Beta\*.txt
#
#  # Excludes all files ending in .cpp in this folder only.
#  \*.cpp
#
#  # Excludes all files ending in .cpp in this folder and all subfolders.
#  *.cpp
#
#  # If "Contoso" is a folder, then Contoso and all its children are excluded.
#  # If it is a file, then only the "Contoso" in this folder is excluded.
#  \Contoso
#
#  # If Help.exe is excluded by a higher .tfignore file or by the Team Project
#  # Collection global exclusions list, then this pattern re-includes it in
#  # this folder only.
#  !\Help.exe    
#
################################################################################

*.pfx
于 2016-02-03T19:24:00.617 回答