Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile'????

  • Thread starter Thread starter SenthilVel
  • Start date Start date
S

SenthilVel

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 '/keyfile' or appropriate project settings instead
of 'AssemblyKeyFile'

Question :

1. which is the best way to convert my assembly key file from its relative
path"..\\..\..\test.snk" to the way .Net Framework 2.0 needs??
2. i have this file in multiple projects (around 300 projects), any short
cut methods so that i can create a utility and update the location of my Snk
???

thanks
Senthil
 
You should be able to specify the key-file in the csproj; IIRC in the
/Project/PropertyGroup/AssemblyOriginatorKeyFile; also, if you are used to
using key-containers (not files), then use
Project/PropertyGroup/KeyContainerName in the csproj.

Try inserting it with the value copied from assembly info:
<AssemblyOriginatorKeyFile>..\..\..\test.snk</AssemblyOriginatorKeyFile>

It seems to work...

For ref, one of the reasons behind not using the assembly attributes is that
they can be read easily through reflection, allowing access to the path the
the SNK (on the build machine). Personally I don't think that's much of a
risk if you protect the file, but heh!

Marc
 
(unless it wasn't clear, I was suggesting writing a utility that does all
this for you; loads the csproj, updates the data, removes the
value from assemblyinfo, etc)

Marc
 
Thanks a lot Marc..

So do u think writing a utility for the 200 + files for

1. Removing \ commenting the entry in the assembly info.cs file
2. editing the Csproj for the insertion of value for
<AssemblyOriginatorKeyFile>

Is the best option ???

by any chance do you have any utility which u have come across???

Thanks
Senthil
 
Yes, I do;

I have code that does similar things that I run as part of automated build;
it updates AssemblyFileVersion, resets file references, etc; not too tricky
to do.

I'm not aware of anything that does this out-of-the-box.

Marc
 
Back
Top