sbornstein2
asked on
How do I create a strong name key file?
Hello all. I am utilizing in one of my applications a DLL. In the setup instructions it is saying if I need to consume the components I must specify a value for the AssemblyKeyFile attribute in the AssemblyInfo file indicating the path to the file containing the key pair used to generate the strong name such as a KeyPair.dat file. It has been a long time since I had to create a AssemblyKeyFile. How do I do that? I know there is a sn.exe in the SDK for VS 2005 but I am not sure what the key pair is and how to create it. Thanks for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Dhaest, thanks for your help. So I did the first link and went into the Visual Studio 2005 Command Prompt. I went to the directory where I wanted to create the key and typed in sn -k keypair.dat and it said Access Denied. Also just so I understand when the documentation I am reading says if I want to use the Core Security components for declarative security and I plan to consume them I must specify a value for the AssemblyKeyFile, do I have to like point to a DLL or something or is this just creating the strong name key and then I reference it in the AssemblyInfo file if that makes sense? Do I have to register this in the GAC etc? Thanks for all your help
ASKER
I do see a keypair.dat file in a directory so I am wondering if I need to create a strong name for that or something.
ASKER
ok so I see there is this dat file key. I assume I have to place that in the directory and then create a AssemblyInfo.cs and then just add the AssemblyKeyFile line, does that sound correct?
ASKER
thanks
http://msdn.microsoft.com/en-us/library/aa559684.aspx