单xbuild错误CS1548 - 密钥文件格式不正确 [英] Mono xbuild error CS1548 - key file has incorrect format
问题描述
所以我试图让VS2010 C#项目去跨平台的。第一个目标是在单声道2.10.5建立它的Windows。我还没有触及任何代码,但 - 我开始与xbuild最近建立SLN文件的能力。 (顺便说一句我用詹金斯触发构建,这不是问题,因为我得到的命令行相同的结果)
我收到错误CS1548:程序集签名时出错。指定的密钥文件`AlphaBeta.pfx'格式不正确。有没有对这个错误很多谷歌果汁。有谁知道什么原因呢? !在此先感谢
低于满输出:
C:\\ \\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution>C:\Program Files\Mono-2.10.5\bin\xbuildAlphaSolution.sln
XBuild引擎版本2.10.5.0
单声道版本2.10.5.0
版权所有(C)马立克Sieradzki 2005-2008,Novell公司2008 - 2011年。
启动生成2011/9/20下午3时54分14秒。
C:\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution\AlphaSolution.sln:警告:忽略vcprojZBM。
C:\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution\AlphaSolution.sln:警告:不知道如何处理GlobalSection TestCaseManagementSettings,忽略。
C:\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution\AlphaSolution.sln:警告:无法找到项目d393406d-3397-4907-a536-2a4b77512bc6
项目C:\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution\AlphaSolution.sln(默认目标(S)):
目标ValidateSolutionConfiguration:
栋的解决方案配置调试|混合平台。
目标体形:
项目C:\Program Files\Jenkins\jobs\AlphaBeta\ ... \AlphaSolution\AlphaCommon\AlphaCommon.csproj(默认目标(S )):
目标PrepareForBuild:
配置:调试平台:值为anycpu
目标GenerateSatelliteAssemblies:
无输入文件目标GenerateSatelliteAssemblies指定了,跳过。
目标CoreCompile:
刀具C:\PROGRA〜1\MONO-2〜1.5\bin\dmcs.bat执行开始参数:/ noconfig /调试:全/调试+ /密钥文件: AlphaBeta.pfx / optimize- /out:obj\Debug\AlphaCommon.dll AlphaCommon.cs Properties\AssemblyInfo.cs /目标:图书馆/定义:DEBUG; TRACE/参考: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 /参考: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 /参考:C:\PROGRA〜1\MONO -2〜1.5\lib\mono\xbuild-frameworks\.NETFramework\v4.0\RedistList\..\..\..\..\4.0\System。 Core.dll /警告:4
:错误CS1548:装配错误期间签署。指定的密钥文件`AlphaBeta.pfx'格式不正确
任务CSC执行 - 失败
完成项目建设目标CoreCompileC:\Program Files\Jenkins\jobs\\ \\AlphaBeta\ ... \AlphaSolution\AlphaCommon\AlphaCommon.csproj.--失败
单不支持使用PKCS#12(.PFX)文件来存储用于strongnaming组件键。这是一个已知的问题,并跟踪对Xamarin的Bugzilla# 725 。
一个解决方法是将密钥导出到.snk文件和建设项目时使用。
答案<一个HREF =http://stackoverflow.com/questions/9255573/pfx-pkcs12-to-snk-conversion-for-mono>这里提供了如何从一个.pfx产生.SNK例子。
So I'm trying to get a VS2010 C# project to go cross-platform. First goal is build it in Mono 2.10.5 for Windows. I have not touched any code yet - I'm starting with xbuild's recent ability to build sln files. (Incidentally I use Jenkins to trigger builds, not that it matters as I get the same result at the command-line.)
I get "error CS1548: Error during assembly signing. The specified key file `AlphaBeta.pfx' has incorrect format". There's not much google juice on this error. Does anyone know what would cause this? Thanks in advance!
Full output below:
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 does not support using PKCS#12 (.pfx) files to store keys used for strongnaming assemblies. This is a known issue and tracked on Xamarin's bugzilla #725.
A workaround is to export your key into a .snk file and use this when building your project.
The answers here provide examples of how to generate an .snk from a .pfx.
这篇关于单xbuild错误CS1548 - 密钥文件格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!