GAC, Strong name and multi developpers

Jarod

Regular
Joined
Feb 5, 2003
Messages
82
Location
Bruxelles
Hello

I have some class library projects and the client-application project that I want to deploy.
So when building the setup project, VS.net add automatically the dll of my class libraries. Good.
However, i want my dll to be installed in the gac. So do what's needed, give them strong name, modyfying the assembly info file with something like :
Visual Basic:
<Assembly: AssemblyKeyFile("c:\SN\myKey.snk")>

And my deployment is ok, working nice....

HOWEVER, I am wondering something.
The project is "stored" under Source Safe so another developper can easily get it and update it. And i am wondering what's happening with the assemblies strong name. Will the new developper have to copy my keys in the same folder ?
Can't we put the snk files under the project (visible in VS.NET), at the root, and giving the assembly a local path ?
I have tried
Visual Basic:
<Assembly: AssemblyKeyFile("myKey.snk")>
but I get an error, not finding the key file
 
Finally found the (too simple) solution.
The key file shall be located relative to the project output directory
So when signing the assembly, just put the key file under the root folder of your project and the assembly looks like :
Visual Basic:
<Assembly: AssemblyKeyFile("..\..\myKey.snk")>
as the project output directory is simply :
<Project Directory>\obj\<Configuration> for local projects

As a consequence, any other developper will get the project AND the key file. As it will be stored reltively to the project, no problem !
 
Back
Top