473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Strong Name Key (SNK) File

1. After I use "sn -k MyKey1.snk" the snk file is created.
2. I then goto my solution and add an existing item.
3. Select the key file I just created
4. It is added to my solution
5. when I click it to edit the assembly data the file opens as a garbage
text file within .Net

I'm I missing something here? The key file when created also does not have
the "key/lock" icon in explorer.

Thanks for any help.
Oct 21 '05 #1
3 6998
Strong name signing is acheived using the AssemblyKeyFile attribute; usually
in the AssemblyInfo.cs/vb source file. You do not simply add it to the
project.
"Tackie" <ta****@msdn.com> wrote in message
news:eN**************@tk2msftngp13.phx.gbl...
1. After I use "sn -k MyKey1.snk" the snk file is created.
2. I then goto my solution and add an existing item.
3. Select the key file I just created
4. It is added to my solution
5. when I click it to edit the assembly data the file opens as a garbage
text file within .Net

I'm I missing something here? The key file when created also does not
have the "key/lock" icon in explorer.

Thanks for any help.

Oct 21 '05 #2
After you create the key file, you leave it where it is.
You then open the AssemblyInfo.vb/cs file and add the
AssemblyKeyFileAttribute.
Since this file is compiled into your project (AssemblyInfo.vb/cs), your
assembly will now have an association to the strong name in the .snk file.
The assembly could now be placed into the GAC if desired.
"Tackie" <ta****@msdn.com> wrote in message
news:eN**************@tk2msftngp13.phx.gbl...
1. After I use "sn -k MyKey1.snk" the snk file is created.
2. I then goto my solution and add an existing item.
3. Select the key file I just created
4. It is added to my solution
5. when I click it to edit the assembly data the file opens as a garbage
text file within .Net

I'm I missing something here? The key file when created also does not
have the "key/lock" icon in explorer.

Thanks for any help.

Oct 21 '05 #3
Go to your assembly.cs file (if you have C#) and a search for
AssemblyKeyFile
Then there add your MyKey1.snk file
Something like this.

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

Remember NEVER to distribute your MyKey1.snk ever otherwise people might use
it and pretend that they are you.
And for all the projects you ceate use that same MyKey1.snk file, this way
people can configure .NET to trust your application only once and every
program that you deliver will be trusted automatically (assuming you do not
use version inumber in the trust)

Ik hope this helps?
Oct 26 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Programatix | last post by:
Hi, I'm trying to apply Strong Name to my project and I get the following error while building the project, Building satellite assemblies... Satellite build for culture 'ms-MY' failed. Please...
6
by: Binesh | last post by:
Hi I used Interop assemblies to read Excel data into DataSet. I am able to run it successfully on my workstation(windows XP and VS .Net 7 and MS Office XP) but when I port my code to...
2
by: John O'Neill | last post by:
Hi I have a c# application that I sign with a strong name key which is fine, but when I add a reference to IWshRuntimeLibrary I get the following error when I build my project:- error CS1577:...
3
by: Clint | last post by:
I cannot make VB.Net 2003 compile an assembly that references a strong name key file unless I put the absolute path in the Assembly attribute. Is this correct? If so, how does one handle...
3
by: Tackie | last post by:
1. After I use "sn -k MyKey1.snk" the snk file is created. 2. I then goto my solution and add an existing item. 3. Select the key file I just created 4. It is added to my solution 5. when I click...
10
by: Chubbly Geezer | last post by:
I have been working on a VB 2005 DLL which has previously been working. I would create the DLL (reporting.dll), install it, run 'gacutil' and 'regasm' and my Access 2000 DB could see it and use...
3
by: spaulsamin | last post by:
Hello Everyone Have nice day!!! Please explain Strong Name key in very simple way with example and How to create it? Paul
8
by: Scott M. | last post by:
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...
6
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.