I would recommend that you generate a single key file for each solution
where the key files are used by the projects within the solution.
If you have assemblies that you re-use across projects:
There are two ways to reuse a project:
a) to include the code in another solution
b) to reference the compiled dll
if you are using (a) in your solutions, then I use the following logic:
a.1) if all of your projects are under a single source tree, then place
the key file closer to the root of the source tree, so that it is in a
directory that is a common ancestor to all of your source directories. That
way, your reference to the key file can still be a relative reference.
a.2) if your shared library is not in a common source tree but you still
intend to share source, place the key file in the same directory as the
AssemblyInfo file.
if you are using (b) in your solutions:
b.1) if all of the projects using the same key file are related, then
use (a.1).
b.2) If the projects are unrelated, use (a.2)
In your assemblyinfo.cs file, ALWAYS use a relative path location. I know
it is a hassle to put in a filename like
"..\..\..\..\..\..\..\..\..\keyfile.snk" However, doing so will allow the
code to be compiled on any developer's workstation simply by fetching the
entire source tree from version control. (this includes for build
machines). If you code "C:\a\b\c\keyfile.snk" and get the source tree onto
the D: drive of a build machine, none of your projects will compile.
Depending on what was on that machine before the compile was initiatited,
the error messages that appear can be anywhere from small (a few lines
pointing at the assemblyinfo file) to severe (hundreds of lines of errors
because an obsolete version of one or more common dlls was on the target
machine).
do not share key files between projects.
Note that key files are used to sign assemblies for the GAC. If you would
also like to sign controls for download to IE, you will need a different set
of procedures. The procedures above are for signing for the GAC and nothing
more.
HTH
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Joel Leong" <ch******@time.net.my> wrote in message
news:10****************************@phx.gbl...
I wish to know the industrial practices for signing
assemblies with key files.
I genereted a key file to sign my assemblies.
Should I sign all my assemblies with a single key files
or I shall generate one key file for each assembly?
Perhaps, I should generate a key file per group of
related assemblies?
Please advice