B
Bill
I have a shared C# class assembly that I am trying to give a
strong-name so I can install it into the GAC on the target machine.
Without delay signing, I've successfully been able to do this by
performing the following steps:
1. Create a public/private key pair by doing the following:
sn -k pubpriv
2. Build and sign the assembly with the following code in the
AssemblyInfo.cs file:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"..\..\pubpriv")]
3. Create and Build a Setup project and place the Primary Output of
the shared assembly project into the "Global Assembly Cache Folder".
The installation succeeds and the assembly is in the GAC. However,
when I try to delay sign the assembly I get an error during
installation. Here are the steps I took in this instance:
1. Create a public/private key pair by doing the following:
sn -k pubpriv
2. Export the public key into a new file by doing the following:
sn -p pubpriv pub
3. Build and delay sign the assembly with the following code in the
AssemblyInfo.cs file:
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile(@"..\..\pub")]
4. Sign the assembly with the private key by doing the following:
sn -R ClassLibrary1.dll "..\..\pubpriv"
5. Create and Build a Setup project and place the Primary Output of
the shared assembly project into the "Global Assembly Cache Folder".
The installation fails with the following error: "An error occured
during the installion of assembly component. {guid} HRESULT:
-2146234299".
Any idea what I'm doing wrong? How do I know that Step 4, where I sign
the assembly, really works other than the message the sn tool gives
me? The modification date on the assembly doesn't change when I run
this, which makes me think that the assembly was never really signed
afterall. Has anyone had this problem?
Thanks.
strong-name so I can install it into the GAC on the target machine.
Without delay signing, I've successfully been able to do this by
performing the following steps:
1. Create a public/private key pair by doing the following:
sn -k pubpriv
2. Build and sign the assembly with the following code in the
AssemblyInfo.cs file:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"..\..\pubpriv")]
3. Create and Build a Setup project and place the Primary Output of
the shared assembly project into the "Global Assembly Cache Folder".
The installation succeeds and the assembly is in the GAC. However,
when I try to delay sign the assembly I get an error during
installation. Here are the steps I took in this instance:
1. Create a public/private key pair by doing the following:
sn -k pubpriv
2. Export the public key into a new file by doing the following:
sn -p pubpriv pub
3. Build and delay sign the assembly with the following code in the
AssemblyInfo.cs file:
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile(@"..\..\pub")]
4. Sign the assembly with the private key by doing the following:
sn -R ClassLibrary1.dll "..\..\pubpriv"
5. Create and Build a Setup project and place the Primary Output of
the shared assembly project into the "Global Assembly Cache Folder".
The installation fails with the following error: "An error occured
during the installion of assembly component. {guid} HRESULT:
-2146234299".
Any idea what I'm doing wrong? How do I know that Step 4, where I sign
the assembly, really works other than the message the sn tool gives
me? The modification date on the assembly doesn't change when I run
this, which makes me think that the assembly was never really signed
afterall. Has anyone had this problem?
Thanks.