Sign Ent.Lib 5.0 using my snk file

Topics: General discussion
Oct 24, 2011 at 4:08 PM

Hi all,

I have source code of EntLib 5.0 (download from codeplex).

Now, I want sign all assemblies of Ent.Lib 5.0 using my snk file, that we have in company.

Which is the best and quick way to do it ?

thanks in advanced, regards

Oct 25, 2011 at 4:06 AM

I'm just curious why you want to sign with your own key?  Unlike some of the earlier releases Microsoft has a signed binary release.

But, in answer to your question, the easiest way would be to open the EnterpriseLibrary.2010 solution file in Visual Studio and then for each project select Properties->Signing and select Sign the Assembly and then select your key file.  If you didn't want to manually do that then you could write a script to manually edit the project files and insert the following at the end of the current list of PropertyGroups:

  <PropertyGroup>
    <SignAssembly>true</SignAssembly>
  </PropertyGroup>
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>keyFile.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com

Oct 25, 2011 at 10:58 AM

Thanks.

I need include assemblies in GAC using company snk file for sign those.

any sample of scripting ?

Oct 26, 2011 at 12:44 AM
alhambraeidos wrote:

Thanks.

I need include assemblies in GAC using company snk file for sign those.

any sample of scripting ?

Alas, no sample.  To be honest it's probably easier to just do it manually unless you plan to do this again with subsequent releases.  It's boring but shouldn't take too long.

I'm still a little hazy on the reason.  Microsoft has released a signed version using their key.  So the assemblies can be placed in the GAC and they use a Microsoft key that is used to sign many other assemblies already in your GAC.

Off the top of my head the only time I would build and sign Enterprise Library is if I need to make changes to the code base.  And with the Dependency Injection approach used that scenario should be occurring less and less.  

You are free to do as you wish -- I'm just trying to steer you in the right direction.  :)

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com