代码之家  ›  专栏  ›  技术社区  ›  MikeG

使用msbuild、team build和tfs中的pfx文件对程序集进行签名

  •  20
  • MikeG  · 技术社区  · 15 年前

    我在尝试使用 Team Build ( MSBuild 对 TFS 2010:


    C:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(1970年):
    无法导入以下密钥文件:ccc.pfx。
    密钥文件可能受密码保护。

    要更正此问题,请尝试再次导入证书,或使用以下密钥容器名称手动将证书安装到强名称CSP:vs_key_c00c673bbb353901

    C:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(1970年):
    已取消导入密钥文件“ccc.pfx”。


    在Visual Studio 2010中,一切都正常。该程序集使用 PFX 文件。通常在Visual Studio中,我们在第一次生成时会提示输入密码,但以后再也不会这样…

    我试过跑步:

    sn -i companyname.pfx VS_KEY_3E185446540E7F7A 
    

    如堆栈溢出问题中建议的其他答复 Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected' . 我已尝试导入到个人证书存储区,如堆栈溢出问题中建议的那样。 Using MSBuild to sign ClickOnce or assembly results in error MSB3321 . 但都无济于事,还是同样的错误。

    我该怎么做?我是否必须以某种方式将证书添加到生成服务运行所使用的Windows帐户或类似的帐户中?

    或者,如何使构建在团队构建中完成而不使用签名?我只想检查它的编译并运行单元测试。我不需要签字。

    6 回复  |  直到 8 年前
        1
  •  9
  •   Community Mohan Dere    9 年前

    this answer

    sn -i companyname.pfx VS_KEY_C00C673BBB353901
    
        2
  •  8
  •   gregmac    15 年前

        3
  •  5
  •   MikeG    15 年前

        4
  •  1
  •   Zar Shardan    14 年前

        5
  •  0
  •   Sunny    11 年前

        6
  •  0
  •   Der_Meister    8 年前

    <PropertyGroup>
      <SignAssembly>false</SignAssembly>
      <AssemblyOriginatorKeyFile>MyKey.pfx</AssemblyOriginatorKeyFile>
    </PropertyGroup>
    

    AssemblyOriginatorKeyFile