none
Enhanced Strong Naming RRS feed

  • Question

  • I am testing Enhanced Strong Naming (http://msdn.microsoft.com/en-us/library/hh415055.aspx) and having some problems getting it into a build process. According to the article you have to delay-sign assemblies first and then re-sign them to get proper Enhanced String Name. That does not work well with the build process. Usually we delay-sign assemblies while developing, and fully sign them on build servers. Does anyone have any experience with Enhanced String Naming?
    Wednesday, December 25, 2013 6:05 AM

Answers

All replies

  • Hi Alex,

    If you use delay signing, system use only public key to sign your assembly. Because the private key is not involved in the signature, so the assembly will throw an exception when validation. You should use “sn –Vr” to turn off the verification. See the following link for details. http://msdn.microsoft.com/en-us/library/t07a3dye(v=vs.110).aspx.

    After using private key to sign your assembly, use the command “sn -Vu” to restart the verification.

    Hope useful.

    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, December 25, 2013 9:57 AM
    Moderator
  • You misunderstood my question. I was asking about using Enhanced Strong Naming in build process. For instance, to use regular signing I can either specify assembly attributes (AssemblyOriginatorKeyFile or AssemblyKeyContainerName) or csc.exe command line options (/keyfile or /keycontainer).

    What I am looking for is the similar way to use Enhanced Strong Naming in build.

    Wednesday, December 25, 2013 5:09 PM
  • Hi Alex,

    Try to use AssemblyDelaySignAttribute and AssemblyKeyFIleAttribute class. Code like below:

                [assembly:AssemblyKeyFileAttribute("myKey.snk")]

          [assembly:AssemblyDelaySignAttribute(true)]

    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.

    Thursday, December 26, 2013 8:01 AM
    Moderator
  • This will produce a regular Strong Name, not Enchanced one.
    Thursday, December 26, 2013 5:37 PM
  • Hi Alex,

    >What I am looking for is the similar way to use Enhanced Strong Naming in build.

    You can use MSBuild to achieve your goal. See MSBuild from the reference below. http://msdn.microsoft.com/en-us/library/dd393574.aspx.

    Tasks provide the code that runs during the build process. MSBuild provides a task list, you can see in the following link. http://msdn.microsoft.com/en-us/library/7z253716.aspx. Those tasks which was not provided, you should write it yourself. See this reference. http://msdn.microsoft.com/en-us/library/t9883dzc.aspx.

    If you have any question about MSBuild, please post on the following forum. http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=msbuild.

    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.


    Monday, December 30, 2013 2:29 AM
    Moderator