AssemblyKeyFile attribute

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

George Durzi

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
 
Hi George,

The path that you pas in the AssemblyKeyFileAttribute is the location of the .snk file, relative to the output of the compiler (rather than the
source file). The reason the samples you see use ..\..\key.snk, is that Visual Studio by default outputs its assemblies in the bin\debug folder and
the .snk file usually lives with the rest of the source code.

-Shawn
http://blogs.msdn.com/shawnfa

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.
--------------------
 
Back
Top