AssemblyKeyFile location problem in ASP.NET Web Application

J

Jarmo Muukka

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
 
S

Scott Allen

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top