locked
Strong naming enterprise library assembly RRS feed

  • Question

  • User1994621691 posted

    Hi,

    I am using Microsoft enterprise library in one of my projects. I am in a need to strong name one of the dlls which is Microsoft.Practices.EnterpriseLibrary.Common. But it is not working.

    When i decompile using ILDASM, it generates 3 files.

    1) IL file 2) .RESOURCES file 3) Common resource script file

    How do i compile it with the key file. Can anyone please specify the ILASM command i should use?

    Please help. Thanks in advance!

    Saturday, June 14, 2014 2:53 PM

All replies

  • User724169276 posted

    Hello,

    Generally Microsoft.Practices.EnterpriseLibrary.Common assembly is stored in the GAC as a strong name file, so no need to add a key for that dll.However you can go through below steps on how to do the same.

    1. Generate a KeyFile

    sn -k keyPair.snk
    

    2. Get the MSIL for the assembly

    ildasm SomeAssembly.dll /out:SomeAssembly.il
    

    3. Rename the original assembly, just in case

    ren SomeAssembly.dll SomeAssembly.dll.orig
    

    4. Build a new assembly from the MSIL output and your KeyFile

    ilasm SomeAssembly.il /dll /key= keyPair.snk
    
    Saturday, June 14, 2014 11:15 PM
  • User1994621691 posted

    hi,


    Thanks for the reply.

    The steps you had suggested will work for a dll that does not contain resources.

    But Microsoft.Practices.EnterpriseLibrary.Common contain some resources. Therefore, when ildasm is run on this dll, it generates an additional .resources file.

    When doing ilasm again as you have specified(with key information), it will generate the strongly named dll file without any error.

    But when i include this dll to my project, it gives build error.
    "type or namespace not found"


    I'm thinking the resource file also should be specified somewhere in the ilasm command. Not sure how to do it.



    Sunday, June 15, 2014 4:41 AM