Results 1 to 5 of 5

Thread: Strong name key files?

  1. #1

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    Strong name key files?

    Is there any way to use a relative path for your strong name key file for an assembly? I currently have:
    Code:
    <Assembly: AssemblyKeyFile("C:\Merrion Computing\Customers\Cooperation\Microsoft\EMFSpoolfileReader\EMFSpoolfileReader.snk")>
    But if I take out the absolute path the compiler throws a hissy fit. Ideas?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

    Question Why?

    Hi.

    Why do you want to use a relative path?

    I may be wrong, but as far as I know, it's only needed when you compile.
    Once the DLL is compiled the file is no longer needed, unless you need to compile it again.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    This is ture - but I share the source code between many developers and it doesn't make sense to force all of us to use the same path structure.
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  4. #4
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

    Fair enough

    Hi.

    Fair enough. Can't argue with that....

    Sorry I don't have a solution though...
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  5. #5
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    Try

    System.Reflection.Assembly.GetExecutingAssembly().Location

    This will return the location (including the DLL/exe name) of the assembly being executed as a string. So just remove the dll/exe name, and add the name of the keyfile.

    I've never done this in an assembly file, so unsure if it will work for sure, but give it a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width