none
Strong Name generation Issue. RRS feed

  • Question

  • Hi All,

    I got problem with LinkPointTransaction.dll(FirstData API for Credit card payment processing). I have included this to my custom abc.dll file and i am trying to generate snk for my abc.dll file, at that time it was showing error messsage
    "Assembly generation failed -- Referenced assembly 'LinkPointTransaction' does not have a strong name".  though i have created a snk for LinkpointTransaction.dll.

    An immediate response would be appreciated

    Thanks in Advance.

     

    Monday, March 15, 2010 8:56 AM

Answers

  • There's an easy workaround. You just have to disassemble and reassemble it with the snk. Like this:

    Disassemble: ildasm myTest.dll /out:myTest.il

    ReAssemble: ilasm myTest.il /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dll

    However, this may be forbidden by the license of that library. You should check that to avoid legal problems. If it's not allowed to tamper with the assembly you probably have to consider scenarios where you use that assembly without signing it!


    -- Blog: http://geeklyeverafter.blogspot.com/
    • Marked as answer by SamAgain Monday, March 22, 2010 3:30 AM
    Monday, March 15, 2010 12:10 PM
  • Hi,Baditala:
        Your scenario is trying to sign a 3rd party assembly. It need to mention that all assemblies referenced by a strong-named assembly must also be strong-named (see here). If this assembly doesn't reference any other assemblies that don't have strong names, you may try the round-trip approach (see here). However, licenses of these 3rd party assemblies should be taken into consideration.
    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Monday, March 22, 2010 3:29 AM
    Monday, March 15, 2010 3:22 PM

All replies

  • You have created an snk for LinkpointTransaction, but is the assembly signed. It has to be signed with the snk you've created.
    -- Blog: http://geeklyeverafter.blogspot.com/
    Monday, March 15, 2010 9:30 AM
  • Hi Bruno,

    Thanks for your response.

    I have created the snk for LinkPointTransaction, but the assembly was not signed. how to sign the assembly with snk.
    Is there any external tool to link those two. I have tried using sn -k, but no use.


    Help me regarding this.


    Thanks in advance.
    Monday, March 15, 2010 11:16 AM
  • Try this:

    sn -Ra targetAssembly.dll strongNameKey.snk

    -- Blog: http://geeklyeverafter.blogspot.com/
    Monday, March 15, 2010 11:18 AM


  • Bruno,

    I tried the same, but again error.

    "LinkPointTransaction.dll" doesnot represent a strongly named assembly.


    Monday, March 15, 2010 11:27 AM
  • Right, sorry about that. The command above would only work if your assembly was already marked as a strong named assembly. Try using the al.exe as stated here: http://dotnet-concepts-queries-interviews.blogspot.com/2007/07/how-to-sign-net-assembly-with-strong.html
    -- Blog: http://geeklyeverafter.blogspot.com/
    Monday, March 15, 2010 11:41 AM
  • Bruno,

    Thanks for your respone. "LinkPointTransaction.dll" is not our own dll. This is third party dll. Hence I am unable to map the snk with that dll.

    I appreciate, if you can suggest any other approach to link the snk file with that assembly. 


    Thanks in advance.

    Monday, March 15, 2010 12:04 PM
  • There's an easy workaround. You just have to disassemble and reassemble it with the snk. Like this:

    Disassemble: ildasm myTest.dll /out:myTest.il

    ReAssemble: ilasm myTest.il /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dll

    However, this may be forbidden by the license of that library. You should check that to avoid legal problems. If it's not allowed to tamper with the assembly you probably have to consider scenarios where you use that assembly without signing it!


    -- Blog: http://geeklyeverafter.blogspot.com/
    • Marked as answer by SamAgain Monday, March 22, 2010 3:30 AM
    Monday, March 15, 2010 12:10 PM
  • Hi,Baditala:
        Your scenario is trying to sign a 3rd party assembly. It need to mention that all assemblies referenced by a strong-named assembly must also be strong-named (see here). If this assembly doesn't reference any other assemblies that don't have strong names, you may try the round-trip approach (see here). However, licenses of these 3rd party assemblies should be taken into consideration.
    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Monday, March 22, 2010 3:29 AM
    Monday, March 15, 2010 3:22 PM