AssemblyKeyFile location problem in ASP.NET Web Application

Discussion in 'ASP .Net' started by Jarmo Muukka, Nov 1, 2004.

  1. Jarmo Muukka

    Jarmo Muukka Guest

    Hello,

    I started to use FxCop to check my assemblies. One requirement is a strong
    name key. Placing the .snk file for library projects was easy. I placed the
    file in project directory and in AssemlyInfo.cs I
    haveAssemblyKeyFile("..\\..\\myprojectname.snk"). This is because the
    compiler has its default directory in <Project
    Directory>\obj\<Configuration> (where Configuration is either Debug or
    Release).

    Now to the problem. I have placed the .snk file into the web application
    directory. I noticed that there is no fool proof way to tell the location in
    AssemblyKeyFile attribute. Compiler has its default directory in
    %HOMEPATH%\VSWebCache\<Machine Name>\<Project
    Directory>\obj\<Configuration>.

    1) I cannot use relative path.
    2) I don't want to use absolute path, because if I move the project or
    rename directories, it breaks. Also, this is not possible solution at work
    in multiple developer projects, because we don't use the same directory
    structure in our computers. We use VSS at work.

    Bad design I would say. Was it designed at all?

    Is there a solution for this?

    And, it is not a solution, if you say that everyone should copy the .snk
    file to %HOMEPATH%\VSWebCache\<Machine Name>\<Project
    Directory>\obj\<Configuration> or use the same directory structure their
    computers.

    JMu
     
    Jarmo Muukka, Nov 1, 2004
    #1
    1. Advertising

  2. Jarmo Muukka

    Scott Allen Guest

    Hi Jarmo:

    The one caveat about FxCop is the rules were designed for class
    libraries and frameworks, not so much for applications. There is no
    need to strong name the code-behind assembly for a web application.
    --
    Scott
    http://www.OdeToCode.com/blogs/scott/


    On Mon, 1 Nov 2004 09:06:42 +0200, "Jarmo Muukka"
    <> wrote:

    >Hello,
    >
    >I started to use FxCop to check my assemblies. One requirement is a strong
    >name key. Placing the .snk file for library projects was easy. I placed the
    >file in project directory and in AssemlyInfo.cs I
    >haveAssemblyKeyFile("..\\..\\myprojectname.snk"). This is because the
    >compiler has its default directory in <Project
    >Directory>\obj\<Configuration> (where Configuration is either Debug or
    >Release).
    >
    >Now to the problem. I have placed the .snk file into the web application
    >directory. I noticed that there is no fool proof way to tell the location in
    >AssemblyKeyFile attribute. Compiler has its default directory in
    >%HOMEPATH%\VSWebCache\<Machine Name>\<Project
    >Directory>\obj\<Configuration>.
    >
    >1) I cannot use relative path.
    >2) I don't want to use absolute path, because if I move the project or
    >rename directories, it breaks. Also, this is not possible solution at work
    >in multiple developer projects, because we don't use the same directory
    >structure in our computers. We use VSS at work.
    >
    >Bad design I would say. Was it designed at all?
    >
    >Is there a solution for this?
    >
    >And, it is not a solution, if you say that everyone should copy the .snk
    >file to %HOMEPATH%\VSWebCache\<Machine Name>\<Project
    >Directory>\obj\<Configuration> or use the same directory structure their
    >computers.
    >
    >JMu
    >
     
    Scott Allen, Nov 1, 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. George Durzi

    AssemblyKeyFile attribute

    George Durzi, Feb 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,569
    Brian Parlier
    Feb 6, 2004
  2. SenthilVel
    Replies:
    1
    Views:
    3,545
    dd_fruend
    Aug 4, 2006
  3. Vahehoo
    Replies:
    0
    Views:
    637
    Vahehoo
    Apr 1, 2007
  4. Replies:
    0
    Views:
    1,823
  5. Norm Dotti

    AssemblyKeyFile in Web Service

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

Share This Page