Deploy an Application in C# .NET
This guide outlines how to deploy an application that uses the PSPDFKit SDK. All redistributable files are located in the Redist folder of the GdPicture .NET installation folder, and all required DLLs are automatically copied to the build folder of your application, just like with any other .NET assembly.
Deploying for COM/ActiveX
For COM/ActiveX clients, the deployment process requires an additional step — registering the
GdPicture.NET.dll file using the Assembly Registration tool (Regasm.exe).
There are two possible ways to register the
Copy the GdPictureComReg.exe tool found in the same location as the GdPicture.NET library core and start it. This tool detects the location of the Regasm.exe tool on your computer and performs the registration.
Perform the registration by invoking the Regasm.exe tool on the command line.
For 32-bit registration:
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe GdPicture.NET.14.dll /codebase /tlb
For 64-bit registration:
%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\regasm.exe GdPicture.NET.14.dll /codebase /tlb:GdPicture.NET.14.64.tlb
Deploying from a Network Location
To deploy your application from a network location, you have to change the system security policy before loading .NET assemblies from network shares.
As this is a major security policy change that can be a potential security breach, it’s recommended to contact your local system and network administrator to make sure it complies with the company security policy before going further.
Carefully read the Microsoft .NET Framework Code Access Security Policy tool documentation.
Network shares get the
LocalInternet permission by default, so you need to use the Code Access Security (CAS) Policy tool (CasPol.exe) that comes with the .NET Framework to grant full trust on network shares and assemblies.
You must have administrator privileges and change the security policy at the machine level.
To trust everything on the \\server\share folder, use the following on the command line:
CasPol.exe -machine -polchgprompt off -addgroup 1.2 -url file://///server/share/* FullTrust
This example should not be used as is since it grants full access to every assembly in a shared folder, which is a bad practice. It needs to be adapted to your own situation.
The options used indicate the following:
-machine— Modifies the machine level of the policy.
-polchgprompt off— Turns the confirmation prompt off, which might be useful in an automated deployment process.
-addgroup 1.2— Adds a code group under group 1.2. In the default policy, group 1.2 is the
LocalIntranetgroup, so the newly created code group is only checked if the file comes from the intranet.
-url file://///server/share/*— The URL must include a protocol. The wildcard character(
*) can be used to specify multiple assemblies from a particular URL. For example, if you use a mapped network drive, type
-FullTrust— Sets the permission to grant assemblies that match the code group.
If you’re running a 64-bit operating system, make sure to run CasPol.exe on both the 32-bit version and the 64-bit version of the framework.