.snk File

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott M.

    .snk File

    After using the sn.exe tool (or using VS 2008) to generate a strong name key
    file and associating my assembly with that strong name, what should I be
    doing with the actual .snk file? Do I deploy that?

    -Scott


  • Mr. Arnold

    #2
    Re: .snk File


    "Scott M." <s-mar@nospam.nosp amwrote in message
    news:%23zC$jUJ4 IHA.4800@TK2MSF TNGP02.phx.gbl. ..
    After using the sn.exe tool (or using VS 2008) to generate a strong name
    key file and associating my assembly with that strong name, what should I
    be doing with the actual .snk file? Do I deploy that?

    You have to deploy the file with the application, otherwise, the file is not
    going to be there when the application looks for it.

    Comment

    • Scott M.

      #3
      Re: .snk File

      Where on the production machine should the .snk file be deployed to?


      "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
      news:ehy%23ayN4 IHA.1420@TK2MSF TNGP06.phx.gbl. ..
      >
      "Scott M." <s-mar@nospam.nosp amwrote in message
      news:%23zC$jUJ4 IHA.4800@TK2MSF TNGP02.phx.gbl. ..
      >After using the sn.exe tool (or using VS 2008) to generate a strong name
      >key file and associating my assembly with that strong name, what should I
      >be doing with the actual .snk file? Do I deploy that?
      >
      >
      You have to deploy the file with the application, otherwise, the file is
      not going to be there when the application looks for it.
      >

      Comment

      • Jeff Winn

        #4
        Re: .snk File

        Hey Scott,

        No you don't distribute the snk file with your application. It's used for
        signing assemblies to create a strongly named assembly, nothing more. If you
        start distributing your key file with your application - anyone would have
        access to your key and be able to create strong named assemblies using your
        key, which would be bad.

        Here's a link for some basic information about strong naming assemblies.
        Perhaps it will give you some more insight on what they're used for:


        If you're delay signing your assemblies this will give you more information
        on it, however you still shouldn't be distributing your key file:
        This article describes delayed or partial signing, which reserves space in the PE file for the strong name signature, but defers the actual signing.


        - Jeff

        "Scott M." <s-mar@nospam.nosp amwrote in message
        news:%23zC$jUJ4 IHA.4800@TK2MSF TNGP02.phx.gbl. ..
        After using the sn.exe tool (or using VS 2008) to generate a strong name
        key file and associating my assembly with that strong name, what should I
        be doing with the actual .snk file? Do I deploy that?
        >
        -Scott
        >

        Comment

        • Mr. Arnold

          #5
          Re: .snk File


          "Scott M." <s-mar@nospam.nosp amwrote in message
          news:OHlNS2T4IH A.3804@TK2MSFTN GP03.phx.gbl...
          Where on the production machine should the .snk file be deployed to?
          I take that back. You don't have to deploy the .snk file.

          I have only used the .snk file a couple of times, but that was during the
          compile of a 3rd party business framework that used the .snk file during
          compilation in the assembly manifest where the manifest pointed to the .snk
          file, to make it a strong named assembly.

          Once the assembly has been compiled using the .snk, then it's a strong named
          assembly and you don't deploy the .snk file with the binaries.

          Sorry for the miss information.


          Comment

          • Mr. Arnold

            #6
            Re: .snk File


            "Scott M." <s-mar@nospam.nosp amwrote in message
            news:OHlNS2T4IH A.3804@TK2MSFTN GP03.phx.gbl...
            Where on the production machine should the .snk file be deployed to?
            >
            Oh, one other thing, if the assembly has to be strong named, it needed to be
            deployed to a production machine and you didn't use the sn.exe tool for the
            assembly, then you use the Gacutil.exe tool to place the binary in the
            Global Assembly Cache of the machine. All assemblies place in the GAC are
            tagged as a strong named assembly.

            Comment

            • Scott M.

              #7
              Re: .snk File

              I don't think that's quite right. All assemblies in the GAC must be strong
              named. This is how we avoid versioning conflicts.


              "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
              news:eeNkEbj4IH A.2064@TK2MSFTN GP04.phx.gbl...
              >
              "Scott M." <s-mar@nospam.nosp amwrote in message
              news:OHlNS2T4IH A.3804@TK2MSFTN GP03.phx.gbl...
              >Where on the production machine should the .snk file be deployed to?
              >>
              >
              Oh, one other thing, if the assembly has to be strong named, it needed to
              be deployed to a production machine and you didn't use the sn.exe tool for
              the assembly, then you use the Gacutil.exe tool to place the binary in the
              Global Assembly Cache of the machine. All assemblies place in the GAC are
              tagged as a strong named assembly.

              Comment

              • Mr. Arnold

                #8
                Re: .snk File


                "Scott M." <s-mar@nospam.nosp amwrote in message
                news:O$Wqi3s4IH A.2348@TK2MSFTN GP06.phx.gbl...
                >I don't think that's quite right. All assemblies in the GAC must be strong
                >named. This is how we avoid versioning conflicts.
                >
                You are correct on the strong named part, but I think the assembly
                publictokenkey is what makes things unique where you can use an assembly
                redirect in the web or app.config pointing to various version of the same
                named assembly in the GAC. Maybe the sn.key is part of pt.key

                Comment

                • Scott M.

                  #9
                  Re: .snk File

                  The .snk contains a public/private key pair. For any assembly to be in the
                  GAC it must be stong named using this pair. If you redirect via your
                  ..config files to another assembly in the GAC, that assembly will still have
                  to be strong named. If you point to a private assembly is doesn't (but
                  still could be).



                  "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
                  news:uS3M6ku4IH A.2064@TK2MSFTN GP02.phx.gbl...
                  >
                  "Scott M." <s-mar@nospam.nosp amwrote in message
                  news:O$Wqi3s4IH A.2348@TK2MSFTN GP06.phx.gbl...
                  >>I don't think that's quite right. All assemblies in the GAC must be
                  >>strong named. This is how we avoid versioning conflicts.
                  >>
                  >
                  You are correct on the strong named part, but I think the assembly
                  publictokenkey is what makes things unique where you can use an assembly
                  redirect in the web or app.config pointing to various version of the same
                  named assembly in the GAC. Maybe the sn.key is part of pt.key

                  Comment

                  Working...