none
Signing problem with VS 2015 - Error signing output with public key from container RRS feed

  • Question

  • Hi all

    We have the following Problem when building our App in Visual Studio 2015:

    Error signing output with public key from container 'VS_KEY_E2E0296D186AC8B3' -- Signature size mismatch. (Exception from HRESULT: 0x80131420)

    In Visual Studio 2013 it builds like a charm...what could this be? What can we change?

    We sign the assembly using a Strong Name Key file.

    Thanks for your help.

    Michael

    Monday, August 24, 2015 12:43 PM

Answers

  • Hi Michael,

    All works with a new certificate (I cannot use your pfx without password). I think there is something wrong with the certificate. To work around it, try recreate a new one.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 28, 2015 3:10 AM
    Moderator

All replies

  • Hi Michael,

    Since it is related to the Strong-Named Assemblies, I help you move this case to the Common Language Runtime Internals and Architecture forum for dedicated support.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 26, 2015 5:18 AM
  • Hi Michael,

    How did you sign that assembly? In visual studio signing tab, using assembly linker or other ways?

    I've tried a new class library project and then sign it in visual studio 2015 according to https://msdn.microsoft.com/en-us/library/xc31ft41(v=vs.110).aspx, I have not see such error message. Have you tried to create a new project to see whether this issue persists? I assume there is something incorrect in your available project. Can you remove those unnecessary code snippet, make a mini repro project, upload to your OneDrive and then share a link to me. I would like to check and let you know my result.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 26, 2015 10:31 AM
    Moderator
  • Hi Herro

    I did sign the assembly using the signing tab in Visual Studio 2015.

    Code from the project file: 

    <SignAssembly>true</SignAssembly>
     <AssemblyOriginatorKeyFile>..\test\something.pfx</AssemblyOriginatorKeyFile>

    I did create a new Project using the same pfx and it did not work:

    Error signing output with public key from container 'VS_KEY_C9F5B9848C6ED1DB' -- Signature size mismatch. (Exception from HRESULT: 0x80131420)

    Then i did create a new Certificate and it did work. what is wrong with my pfx file, that it works with VS 2013 but not with 2015?

    TestProject

    Regards,




    Thursday, August 27, 2015 6:11 AM
  • Hi Michael,

    All works with a new certificate (I cannot use your pfx without password). I think there is something wrong with the certificate. To work around it, try recreate a new one.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 28, 2015 3:10 AM
    Moderator
  • Hi all,
    experiencing the same issue, I think the cause is in the new version of the signing tool sn.exe, that is used both for keys generation and the eventual signing with previously generated. The new version of the tool does not seem to handle well usage keys generated by previous version, particularly if they were generated with non-standard key size.
    Previously I have generated the keys used for signing by a command like
    sn -k 384 Pk."%1".KeyPair.snk
    sn -p Pk."%1".KeyPair.snk Pk."%1".Public.snk
    sn -tp Pk."%1".Public.snk > Pk."%1".Public.txt

    specifying 384 the size of the key, and the first argument %1 being the particular project name.
    With key generated that way, signing has failed as described (...Signature size mismatch...)

    If I replace the first line with just 
    sn -k Pk."%1".KeyPair.snk
    and re-generate the key, everything works.
    Tuesday, September 1, 2015 7:45 PM