gpt4 book ai didi

c# - Mono xbuild 错误 CS1548 - key 文件格式不正确

转载 作者:太空狗 更新时间:2023-10-30 01:25:11 26 4
gpt4 key购买 nike

所以我正在尝试让 VS2010 C# 项目跨平台。第一个目标是在 Windows 的 Mono 2.10.5 中构建它。我还没有接触任何代码——我从 xbuild 最近构建 sln 文件的能力开始。 (顺便说一下,我使用 Jenkins 来触发构建,这并不重要,因为我在命令行得到了相同的结果。)

我收到“错误 CS1548:程序集签名期间出错。指定的 key 文件‘AlphaBeta.pfx’格式不正确”。这个错误没有太多谷歌果汁。有谁知道是什么原因造成的?提前致谢!

完整输出如下:

C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution>"C:\Program Files\Mono-2.10.5\bin\xbuild" AlphaSolution.sln 
XBuild Engine Version 2.10.5.0
Mono, Version 2.10.5.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.

Build started 9/20/2011 3:54:14 PM.

C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaSolution.sln: warning : Ignoring vcproj 'ZBM'.
C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaSolution.sln: warning : Don't know how to handle GlobalSection TestCaseManagementSettings, Ignoring.
C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaSolution.sln: warning : Failed to find project d393406d-3397-4907-a536-2a4b77512bc6
Project "C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaSolution.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Mixed Platforms".
Target Build:
Project "C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaCommon\AlphaCommon.csproj" (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Tool C:\PROGRA~1\MONO-2~1.5\bin\dmcs.bat execution started with arguments: /noconfig /debug:full /debug+ /keyfile:AlphaBeta.pfx /optimize- /out:obj\Debug\AlphaCommon.dll AlphaCommon.cs Properties\AssemblyInfo.cs /target:library /define:"DEBUG;TRACE" /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.Xml.Linq.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.Data.DataSetExtensions.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\Microsoft.CSharp.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.Data.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.Xml.dll /reference:C:\PROGRA~1\MONO-2~1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System.Core.dll /warn:4
: error CS1548: Error during assembly signing. The specified key file `AlphaBeta.pfx' has incorrect format
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "C:\Program Files\Jenkins\jobs\AlphaBeta\...\AlphaSolution\AlphaCommon\AlphaCommon.csproj".-- FAILED

最佳答案

Mono 不支持使用 PKCS#12 (.pfx) 文件来存储用于强命名程序集的 key 。这是一个已知问题并在 Xamarin 的 bugzilla 上进行了跟踪 # 725 .

解决方法是将 key 导出到 .snk 文件中,并在构建项目时使用它。

答案 here提供如何从 .pfx 生成 .snk 的示例。

关于c# - Mono xbuild 错误 CS1548 - key 文件格式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7492822/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com