Results 1 to 6 of 6

Thread: Strong Naming/signing

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Strong Naming/signing

    What is the procedure to Strong Name/sign an assembly?

    I have managed to create a strongname key using sn -k keyfile.snk

    I added this in the assemblyinfo.cs:

    [assembly: AssemblyKeyFile("..\\..\\keyfile.snk")]

    I then compiled the project, compiled fine. Now what?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Strong Naming/signing

    The point of strong-naming is to uniquely identify your assembly. No-one can substitute another assembly or edit yours and pass it off as the original. That way no-one can change the way an application works without the user knowing. If the system can't find an assembly with the specific strong name it's looking for then it will not run the app, even if it finds an assembly with the same name, size and interface. That adds a level of security against hackers who would try to change the way an application works by substituting or editing existing assemblies.

    The main thing to note now is that if your assembly has a string name then all the assemblies it references must also have string names. You can't trust an assembly your using if it can't trust the assemblies it's using.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Strong Naming/signing

    I do require this Is the procedure I have written done correctly or do I need to do something else?
    I require this to comply with one of the SDK's I am using

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Strong Naming/signing

    Use it. If you want to go the extra step, do a search on code access security (caspol.exe) and you could also place it in the GAC.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Strong Naming/signing

    Are you using VS 2005? Please assume that it is ALWAYS necessary and specify your version in EVERY thread. If you are then you don't need to muck about with any code. Just open the Signing tab of the project properties and click the appropriate box. You can then create a new key file or select an existing one.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Strong Naming/signing

    Thanks, this is for .NET 1.1 (VS2003)

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width