Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. AssemblyKeyFile

AssemblyKeyFile

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devvvy
    wrote on last edited by
    #1

    Hi, how do you specify "RELATIVE" path for ASP.NET apps? (webapp.snk resides in same directory of the application dll - ie. bin\) This keeps giving me error message saying it can't find the snk file... Thanks in advance. Norman Fung

    P M 2 Replies Last reply
    0
    • D devvvy

      Hi, how do you specify "RELATIVE" path for ASP.NET apps? (webapp.snk resides in same directory of the application dll - ie. bin\) This keeps giving me error message saying it can't find the snk file... Thanks in advance. Norman Fung

      P Offline
      P Offline
      Plunging_Falcon
      wrote on last edited by
      #2

      Use the MapPathServer command - it will give you the root directory (above \bin).

      1 Reply Last reply
      0
      • D devvvy

        Hi, how do you specify "RELATIVE" path for ASP.NET apps? (webapp.snk resides in same directory of the application dll - ie. bin\) This keeps giving me error message saying it can't find the snk file... Thanks in advance. Norman Fung

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        Hi Norman, You can find the answer in the AssemblyInfo.cs file which should be included in your web project. Basically, you use either the AssemblyKeyFileAttribute or the AL.exe tool to sign your assembly with a strong name. Here, you want to use the AssemblyKeyFileAttribute with a relative path, so you would specify this attribute as below:

        [assembly: AssemblyKeyFile(@"..\\..\\Webapp.snk")]

        then you need to copy the key file Webapp.sink to the project directory which is specified as

        %HOMEPATH%\VSWebCache\<Machine Name>\< Project Directory>\obj\<Configuration>

        For example with my machine:

        C:\Documents and Settings\minhphan.SILKROAD\VSWebCache\CONGMINH\WebApplication1\obj

        D 1 Reply Last reply
        0
        • M minhpc_bk

          Hi Norman, You can find the answer in the AssemblyInfo.cs file which should be included in your web project. Basically, you use either the AssemblyKeyFileAttribute or the AL.exe tool to sign your assembly with a strong name. Here, you want to use the AssemblyKeyFileAttribute with a relative path, so you would specify this attribute as below:

          [assembly: AssemblyKeyFile(@"..\\..\\Webapp.snk")]

          then you need to copy the key file Webapp.sink to the project directory which is specified as

          %HOMEPATH%\VSWebCache\<Machine Name>\< Project Directory>\obj\<Configuration>

          For example with my machine:

          C:\Documents and Settings\minhphan.SILKROAD\VSWebCache\CONGMINH\WebApplication1\obj

          D Offline
          D Offline
          devvvy
          wrote on last edited by
          #4

          Thanks, I got it working now :) Norman Fung

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups