AssemblyKeyFile attribute

  • Thread starter Thread starter George Durzi
  • Start date Start date
G

George Durzi

Sorry to double post, but I figured I would get a better response here.


Trying to assign a strong name to my assembly. I've created the .snk file
for it.
My assembly is called Common. Mail

In Assembly.cs, if I do this:
[assembly: AssemblyKeyFile(@"C:\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Bin\Common.Mail.snk")]
it works great, but I don't wanna hardcode the path to the bin directory,
since it might change.

In the help documenation, they had it shown as
[assembly: AssemblyKeyFile(@"..\..\Common.Mail.snk")]
but that doesn't work ...

I'm assuming ..\..\ was trying to get to the v1.1\Bin directory but wasn't.
How do I do this without hardcoding the path
 
[assembly: AssemblyKeyFile(@"..\..\Common.Mail.snk")]

is using relative pathing to the keyfile location (not the bin).

I generally create a common directory for key files and point the attribute
to that location. This for security as well as ease of maintance. The key
file contains the private portion of the key. If this becomes compromized
then there is a potential for a hack.

Good luck,
Brian Parlier
 
Back
Top