AssemblyKeyFile attribute

Discussion in 'ASP .Net' started by George Durzi, Feb 5, 2004.

  1. George Durzi

    George Durzi Guest

    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
     
    George Durzi, Feb 5, 2004
    #1
    1. Advertising

  2. [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

    "George Durzi" <> wrote in message
    news:uFFr#...
    > 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
    >
    >
    >
     
    Brian Parlier, Feb 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jarmo Muukka
    Replies:
    1
    Views:
    1,708
    Scott Allen
    Nov 1, 2004
  2. Bostonasian
    Replies:
    1
    Views:
    836
    Joris Gillis
    Sep 18, 2005
  3. SenthilVel
    Replies:
    1
    Views:
    3,542
    dd_fruend
    Aug 4, 2006
  4. Vahehoo
    Replies:
    0
    Views:
    636
    Vahehoo
    Apr 1, 2007
  5. Norm Dotti

    AssemblyKeyFile in Web Service

    Norm Dotti, Aug 19, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    153
    Norm Dotti
    Aug 19, 2003
Loading...

Share This Page