【问题标题】:Must Reenter PFX Password Every Time Developer Pulls Branch from TFS Workaround?每次开发人员从 TFS 解决方法中提取分支时都必须重新输入 PFX 密码吗?
【发布时间】:2016-05-03 14:34:54
【问题描述】:

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

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

强制他们为所有 11 个程序集重新输入相同的密码 [下图]。对于这个非常耗时的冗长问题,有什么解决方案/修复方法?

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

【问题讨论】:

    标签: passwords clickonce pfx strong-named-key


    【解决方案1】:

    已通过阻止 .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 - Cloaking in TFS

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

      AIS Blog - excluding-files-from-team-foundation-version-control-using-tfignore-files

    最后,我发现 .tfignore 是最好的解决方案。 .tfignore 是通过在 Pending Changes Page 的 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
    

    【讨论】:

      猜你喜欢
      • 2013-08-15
      • 1970-01-01
      • 2021-01-05
      • 2019-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-06
      相关资源
      最近更新 更多