Skip to main content
I'm trying to build smart forms in my strongly named solution. I am unable to do this because the K2SmartForms.dll does not have a strong name.

How do I use K2 Smart forms referenced from strongly named assemblies?
When adding an assembly to the Global Assembly Cache (GAC) and the assembly contains a reference to another assembly, the referenced assembly must also be strongly named.

NOTE: Only Strongly Named Assemblies can be added to the GAC.

A strong name constitutes the assembly's identity, which is:

Its simple text name
Version number
Culture information (if provided)
A public key and a digital signature. It is generated from an assembly file using the corresponding private key. (The assembly file contains the assembly manifest, which contains the names and hashes of all the files that make up the assembly.)

Note: Once you give an assembly a strong name, all referenced assemblies must have strong names as well. This ensures that the security of the strongly named assembly is not compromised. Strong naming is applied to the assembly when it is created.

To illustrate, the K2mng.dll is not strongly named. Therefore, any assembly that references it cannot be added to the GAC.


To work around this do the following:

1. Produce the Microsoft intermediate language (MSIL) for the assembly using the ILDASM.EXE utility.

i. Obtain the MSIL for the provided assembly
From a VS.NET command prompt, enter the following: (assuming you have copied the K2mng.dll to C:)
c:>ildasm k2mng.dll /out:k2mng.il

ii. Rename/move the original assembly
Rename C:K2mng.dll to K2mng.old or move the file to a different location.

iii. Create a new assembly from the MSIL output and your assembly keyfile
Assuming you already have an assembly key pair file (if not, see below), do the following from a VS.NET command prompt:
c:>ilasm K2mng.il /dll /key=K2mng.snk

2. When step 1 is complete use an assembly key file to sign that MSIL into a new DLL using the ILASM.EXE utility.

i. Create a strong name assembly key file
From a VS.NET command prompt, use the SN.EXE utility to create a file containing the public key/private key pair:
c:>sn -k c:K2mng.snk
Great stuff.

Shouldn't SourceCode make sure to strongly name all their assemblies? Seems a bit weird to me that they're not.

Anyways, I'd be happy to sign them with my own key.
I've done the previous process and it worked well.

However, xml fields do not work any more - any data sent to them is lost to the binary space. No error message, no log entry, just an empty string in return.

Everything else seems to work all right.

When I check the field in Workspace, I see an empty xml-skeleton according to the xml schema that belongs to the field. The K2 control on the SmartForms page gets an empty string.

Any idea?

Reply