473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

AssemblyKeyFile location problem in ASP.NET Web Application

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
Nov 18 '05 #1
1 1329
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"
<jm*****@nospamto.hotmail.com> 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


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ram | last post by:
Hey, Whenever I add the "AssemblyKeyFile" attribute to a ClassLibrary project I created on my Win XP computer, the "Rebuild" take almost a minute! When I mark that line, the rebuild time is merely...
1
by: George Durzi | last post by:
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 ...
18
by: Nak | last post by:
Hi there, Does anyone know what path the AssemblyKeyFile attribute is relative to? For example I currently have mine set to <Assembly: AssemblyKeyFile("..\NicksKey.snk")> Sometimes this...
0
by: Ram | last post by:
Hey, Whenever I add the "AssemblyKeyFile" attribute to a ClassLibrary project I created on my Win XP computer, the "Rebuild" take almost a minute! When I mark that line, the rebuild time is merely...
1
by: gowens | last post by:
I've been trying to strong name my VB.Net v1.1 assembly with the strong name key that we're using for a project. The strongname.snk file is located in a root-level directory. No matter what I...
1
by: SenthilVel | last post by:
Hi I am in the Process of conversion of my existing 1.1 Dotnet Code to 2.0 framework. for each project when i compile in VS2005 , i get this error\warning: Use command line option...
4
by: SenthilVel | last post by:
Hi I am in the Process of conversion of my existing 1.1 Dotnet Code to 2.0 framework. for each project when i compile in VS2005 , i get this error\warning: Use command line option...
4
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, When using property assembly: AssemblyKeyFile in Visual Studio 2005, I find that it is not supported and we need to using Project --Properties --> Signing Tab to specify the...
0
by: coopdog | last post by:
This is a new issue as of an install to sp1 on vb express 2005. When I publish the application to my drive then I try to install it is wants to be installed from the same location as it was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.