473,322 Members | 1,734 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,322 software developers and data experts.

.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
Jul 8 '08 #1
8 2249

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.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.

Jul 8 '08 #2
Where on the production machine should the .snk file be deployed to?
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:eh****************@TK2MSFTNGP06.phx.gbl...
>
"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.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.

Jul 8 '08 #3
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:
http://msdn.microsoft.com/en-us/libr...ad(VS.71).aspx

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:
http://msdn.microsoft.com/en-us/library/t07a3dye.aspx

- Jeff

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.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
Jul 10 '08 #4

"Scott M." <s-***@nospam.nospamwrote in message
news:OH**************@TK2MSFTNGP03.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.
Jul 10 '08 #5

"Scott M." <s-***@nospam.nospamwrote in message
news:OH**************@TK2MSFTNGP03.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.

Jul 10 '08 #6
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. Ar****@Arnold.comwrote in message
news:ee**************@TK2MSFTNGP04.phx.gbl...
>
"Scott M." <s-***@nospam.nospamwrote in message
news:OH**************@TK2MSFTNGP03.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.

Jul 10 '08 #7

"Scott M." <s-***@nospam.nospamwrote in message
news:O$**************@TK2MSFTNGP06.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

Jul 11 '08 #8
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. Ar****@Arnold.comwrote in message
news:uS**************@TK2MSFTNGP02.phx.gbl...
>
"Scott M." <s-***@nospam.nospamwrote in message
news:O$**************@TK2MSFTNGP06.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

Jul 11 '08 #9

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.