Putting a delayed sign assembly into my PC's GAC

S

subi

Hi,

I don't know where's the best place to post my question.
I hope it suits this group.

I have created an assembly with a delay sign attribute
set to true in the AssemblyInfo.cs. And the key file
attribute points to a "snk" file contains only public key.
After I compile the assembly, I set it to skip
verification by using "sn.exe -Vr" tool.

Doing so, I hoped my PC's GAC won't verify the assembly.
But, apparently as I drag the assembly from its location
to the GAC folder, there's a "install failed" error: "The
check of the signature failed for assembly 'xxxxx.dll'."

My questions are: can't I put my delayed sign assembly
into GAC? If I can, how can I do it. If not, then how am I
suppose to test the whole application with so many common
assemblies with delayed signing?

Thanks a lot,
subi
 
P

Paulo Lisboa [MSFT]

subi,
First, I would suggest for you to check whether your sn.exe call really
succeeded. Recheck everything the documentation says to see if you are
providing the assembly name correctly.

Anyway, if at some point you need a quick solution to keep working, and if
you are mostly using ASPNET applications, then you can consider to add your
assembly name to machine.config (see below) so that it will already be
loaded in memory and therefore you just need to reference it based on its
class names from whithin your aspx/asmx. In this case, you could fully sign
it with some temporary key pair and later on you could re-sign with your
final key pair. In this case, you would have to remember to change the
PublicKeyToken from the node below whenever you re-signed your assembly.
<add assembly="MyAssemblyName, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />

In summary, re-check your use of sn.exe but also keep in mind that
re-resigning fully signed assemblies is also possible.

--
Thanks.
Paulo

DISCLAIMER: This posting is provided "AS IS" with no warranties, and confers
no rights. Use of any included code samples are subject to the terms
specified at http://www.microsoft.com/info/cpyright.htm"
 
C

Conrad Zhang

sn -Vr should let you install delay signed assembly intoGAC. If drag&drop
does not work, try gacutil.

sn -Vl will show you the list assemblies that are delay-signed.
 

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