Strong naming

  1. #1

    Strong naming

    Hello devs,

    I*like*your Coolite assembly. I went to use it in my project, but the assembly is not strong named. WHY?
    Are you going to sing it*in*the*next*release?*When*is*it*going*to*be?

    Thanks, Peter
  2. #2

    RE: Strong naming



    Hi Peter,

    I investigated this issue and it looks like some kind of problem happens when we combine the .dll's in our final build process. We use a build tool called ILMerge (http://tinyurl.com/9xuqf) to combine three .dll's into one, all of which are properly Strong Named before the merge, but for some reason the .snk does not get applied to the final merged .dll.

    We're trying a few things to get this to work. If all else fails, we'll include all three .dll's individually with the next release. Come to think of it, that would not be a bad idea anyways.

    I should have another update for you very shortly.
    Geoffrey McGill
    Founder
  3. #3

    RE: Strong naming



    Ok, I found the problem and fixed it.

    Just in case anyone finds this post in the future and wonders what was going wrong...

    In order to get ILMerge to StrongName your final merged Assembly, you have to set the /keyfile command line argument to point to the .snk that ILMerge will use to for the final combined .dll.

    Example

    /keyfile:"$(ProjectDir)Properties\Coolite.Web.UI.snk"
    Hope this helps.

    This updated strong named .dll will be available with version 0.4.1 (or higher).
    Geoffrey McGill
    Founder
  4. #4

    RE: Strong naming



    For interest sake, here's a quick little script for determining if an Assembly has been Strong Named or not.

    The following blog post is the source of this code and has more information.

    http://www.dotnet-blog.com/index.php...-named-or-not/

    Example

    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Assembly assembly = Assembly.GetAssembly(typeof(Coolite.Web.UI.ScriptManager));
            if (assembly != null)
            {
                AssemblyName name = assembly.GetName();
                byte[] key = name.GetPublicKey();
                bool isSigned = key.Length > 0;
                Response.Write(string.Format("Is Signed: {0}", isSigned));
            }
        }
    </script>
    Geoffrey McGill
    Founder
  5. #5

    RE: Strong naming

    Yes, there are other ways to find out whether an assembly has been strong named (based on looking for the public key):

    "C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn.exe" -T assembly.dll
    - of course, you can use a different version of .Net SDK.

    I wouldn't mind if you released just one dll, but please, sign it.
  6. #6

    RE: Strong naming

    The version 0.4.1 build has been released.

    This build includes a single combined Coolite.Web.UI.dll file which has been signed properly.

    Hope this helps.
    Geoffrey McGill
    Founder
  7. #7

    RE: Strong naming

    Thank*you,*now it*works*nicely.*Peter*

Similar Threads

  1. Replies: 2
    Last Post: Mar 27, 2009, 6:06 PM

Posting Permissions