Hi all,
I’m working on a PDF processing feature that requires the use of PdfiumViewer.dll along -with the platform-specific native library pdfium.dll.
In my local Creatio environment, I was able to make it work by manually placing the x64 version of pdfium.dll in the bin folder of the installation.
However, I haven’t found a way to add this kind of native DLL through the Creatio UI to have it available in the Cloud environment of the client.
Could you advise on the proper way to include a native platform-specific DLL like pdfium.dll in a cloud-deployed Creatio instance?
Is there any way to include that in the package?
Thanks!
Like
Andres,
Hello!
The error "File 'pdfium.dll' is not a valid .Net assembly" indicates that you're trying to load an incorrect type of library for the .NET platform.
pdfium.dll is a native (unmanaged) library, not a managed .NET assembly. Any .NET development environment, including Creatio, expects only .DLL files compiled for .NET. Platform-specific native DLLs like pdfium.dll cannot be imported directly as .NET assemblies.
As a workaround, you may consider trying the following approach:
To do this:
1) Open the Files folder of the required package.
2) Create a new subfolder inside it—for example, name it Libs.
3) Place the required .dll file into the newly created folder.
4) Open the .csproj file of the package.
5) In the "3rd Party References" section, add a reference to the native library.
For example:
<ItemGroup Label="3rd Party References">
<Reference Include="$(RelativePkgFolderPath)/<PackageName>/Files/Libs/<NativeLib>.dll">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
</ItemGroup>
After completing these steps, you can compile the package, proceed with the development and later install it on the cloud environment. This approach enables the use of native libraries within your package.
One way is to use the Import option in your package:
Other options, add to Files\bin in an assembly package (and add reference to csproj file), see https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/development-tools/packages/assembly-package
Ryan
Also need to make sure that any dependencies and trust level will work with cloud hosted systems.
Hi Ryan,
I usually add referenced assemblies using the import option you mentioned there, but thats not working for platform-specific assembies or native assemblies (the ones that need to know if its x64 or x86).
trying to load that type of assembies is showing an error message:
Will check with assembly package if that works. Thanks!
Andres,
Hello!
The error "File 'pdfium.dll' is not a valid .Net assembly" indicates that you're trying to load an incorrect type of library for the .NET platform.
pdfium.dll is a native (unmanaged) library, not a managed .NET assembly. Any .NET development environment, including Creatio, expects only .DLL files compiled for .NET. Platform-specific native DLLs like pdfium.dll cannot be imported directly as .NET assemblies.
As a workaround, you may consider trying the following approach:
To do this:
1) Open the Files folder of the required package.
2) Create a new subfolder inside it—for example, name it Libs.
3) Place the required .dll file into the newly created folder.
4) Open the .csproj file of the package.
5) In the "3rd Party References" section, add a reference to the native library.
For example:
<ItemGroup Label="3rd Party References">
<Reference Include="$(RelativePkgFolderPath)/<PackageName>/Files/Libs/<NativeLib>.dll">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
</ItemGroup>
After completing these steps, you can compile the package, proceed with the development and later install it on the cloud environment. This approach enables the use of native libraries within your package.