Bug 725 - Error CS1548: Error during assembly signing.
Summary: Error CS1548: Error during assembly signing.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 2.6 RC 1
Hardware: PC Windows
: Low normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2011-09-10 14:33 UTC by Chris Hardy [MSFT]
Modified: 2017-06-16 23:56 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

sn key file (1.72 KB, application/x-pkcs12)
2011-09-12 20:43 UTC, minco

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 725 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Chris Hardy [MSFT] 2011-09-10 14:33:08 UTC
error CS1548: Error during assembly signing. The specified key file `xxx.key.pfx' has incorrect formatWhen I signing a class type project, it build success on Visual Studio 2010
Comment 2 Marek Safar 2011-09-12 11:22:28 UTC
Could you attach the actual key or generate one which causes same problem
Comment 3 Sebastien Pouliot 2011-09-12 16:01:54 UTC
.pfx are PKCS#12 files. It looks like newer (2010?) version of Visual Studio allows people to strong name assemblies using them.

Mono.Security.dll support PKCS#12 files (mscorlib.dll too but only when used with X.509 certificates) but it's not clear that we want to embed all that code into the compiler!?!
Comment 4 Marek Safar 2011-09-12 17:12:52 UTC
Sebastian, can you attach example of such key
Comment 5 minco 2011-09-12 20:43:52 UTC
Created attachment 335 [details]
sn key file

it contains passord:123456
Comment 6 minco 2011-09-12 20:52:00 UTC
The sn key file were created by virsual studio 2010.
If I create a sn key file by %Program Files%\Mono-2.10.5\bin\sn.bat, both virsual studio 2010 and monodevelop 2.6 works, but no password.
Comment 7 Sebastien Pouliot 2011-09-13 11:33:06 UTC
Marek, I don't have a windows VM running at the moment but Minco's attachment is a valid pkcs#12 file, but without a certificate - i.e. only an encrypted keypair.

Minco, Mono's 'sn' tool (sn.bat on windows) currently only supports .snk (password-less files) and key containers. The same is true for the xMCS compilers.
Comment 8 Marek Safar 2011-09-16 09:09:04 UTC
I have done some further investigation and the way how it works with VS is that the file does not have to be installed but VS asks for a password and creates temporary container, the command line to C# compiler then contains key container


I don't know whether XXXX is some file hash

I am leaving this as MD bug as it cannot send such files to compiler using -keyfile option