Delay Signing of Strong Name Assemblies

T

Timm Hagen

I am trying to strong name an ASP.NET Application. I have been
successfull if I supply the private key file, but now I am trying to
use delayed signing to create the assembly but with no success. I get
the following error ... The check of the signature failed for assembly
'Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces'.

My solution is set up with 3 projects 1 VB.NET and 2 C#. The VB.NET
one is an ASP.NET project and it uses project reference to the other
project which is the Microsoft Application Block ExceptionManagement
and that one project references the Microsoft Application Block
ExceptionManagement Interfaces project.

All three solution build, but the problem is when I run the ASP.NET
project. I have tried using the sn -Vr <Path>\<Assembly Name> for
each on the output dll but that doesn't seem to do anthing for me. I
run the sn -Vl and they are listed in the list. Can anybody help?
 
H

Hermit Dave

[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile(@"..\..\keys\crypto_public.snk")]
[assembly: AssemblyKeyName("")]

from one of my projects.... you have to specify the correct relative path
for the key...

and then u use
sn -R sn -R myAssembly.dll crypto.snk
to delay sign the assembly....
 
T

Timothy Hagen

This is what I have in the 3 project assemblyinfo files

IssueTrack.Web
<Assembly: AssemblyDelaySign(True)>
<Assembly:
AssemblyKeyFileAttribute("C:\Code\Key\IssueTrack.Web.PublicKey.snk")>


Microsoft.ApplicationBlocks.ExceptionManagement
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile(@"C:\Code\Key\Paisley.PublicKey.snk")]


Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile(@"C:\Code\Key\Paisley.PublicKey.snk")]


Now the first depends on the second through a project reference and the
second depends on the third through a project reference. Do I need the
AssemblyKeyName("") if it is empty? I have been around and around with
trying to get this strong name delay signing to work.
 
H

Hermit Dave

Attaching some comments from assemblyInfo.cs file

// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name)
utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the "project output directory". The location of the
project output
// directory is dependent on whether you are working with a local or
web project.
// For local projects, the project output directory is defined as
// <Project Directory>\obj\<Configuration>. For example, if your
KeyFile is
// located in the project directory, you would specify the
AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// For web projects, the project output directory is defined as
// %HOMEPATH%\VSWebCache\<Machine Name>\<Project
Directory>\obj\<Configuration>.
// (*) Delay Signing is an advanced option - see the Microsoft .NET
Framework
// documentation for more information on this.
//

you need relative path
HTH
 
H

Hermit Dave

sorry attached comments from a web project
here's the correct one

(*) In order to create a KeyFile, you can use the sn.exe (Strong Name)
utility.

// When specifying the KeyFile, the location of the KeyFile should be

// relative to the project output directory which is

// %Project Directory%\obj\<configuration>. For example, if your KeyFile is

// located in the project directory, you would specify the AssemblyKeyFile

// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]

// (*) Delay Signing is an advanced option - see the Microsoft .NET
Framework

// documentation for more information on this.
 
T

Timothy Hagen

Still can't get it to work I tried both ways mine and the documentation
way and still am having problems. They don't have a problem compiling,
but the problem exist when I try and run the project. I get the
error....

Server Error in '/Code/Playground/StrongNameTest' Application.
------------------------------------------------------------------------
--------

Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: The check of the signature failed for assembly
'StrongNameTest'.

Source Error:


Line 196: <add assembly="System.EnterpriseServices,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 198: <add assembly="*"/>
Line 199: </assemblies>
Line 200: </compilation>

If you have a little time and would like to see this project I can zip
it up and send it to you offline. I have been stumbling on this one for
awhile now.
 
T

Timothy Hagen

We figured it out. My problem was related to IIS needing to be
restarted before the Verfication Skipping changes would take place (sn
-Vr *,<Public Token>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top