cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Custom DLL creation.

LeonStroschein
Level 3
Hi All,
I'm using VS2019 and C# to create a custom DLL to parse a Flat File and return a DataTable.
I'm using the latest developer version of BP (6.6.015260) I have chosen .Net 4.7 as the target framework.
My DLL references System, System.Core, System.Data, System.Xml. I have tried Platform Target of all 3 types Any Cpu, x86, x64.
I have copied the DLL to the BP program folder, added the Namespace and Reference to it.
I get the same error everytime I try to run it.
"Internal : Could not execute code stage because exception thrown by code stage: Could not load file or assembly 'BPTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

Any idea what I'm doing wrong? Any resource that explains how to create and use custom DLLs with BP?
Thanks for any help!

------------------------------
Leon
------------------------------
11 REPLIES 11

Without talking to our product team, I don't know all the differences in using the x64 over the x86 installer.

Yes, current Blue Prism versions will run as a 32bit process, however the installation path will differ depending on the version installed.

As mentioned previously, this is straight forward normally so can only assume there is a problem in the method or wrapper code. I have created and distributed many dll's for clients which have successfully been executed from within a Blue Prism code stage. These have been compiled as use "Any CPU". The only difference has been that these were written in VB.net and not C#.net.

Difficult to diagnose without reviewing the C# code.

------------------------------
Carl Carter
Developer Program Manager
Blue Prism
Europe/London
------------------------------

Hello to everyone,

I think that I have finally figured out the issue, and problem solved.

I had not been consistently copying over the accompanying ".pdb" file with the DLL.  So interestingly enough, not doing that allows BP to validate the code against the DLL, but not run correctly at run time.  I'm sure that this make complete sense for those in the know, and I was under the impression that compiling with the "Optimize Code" setting and not checking the "Define DEBUG constant" and "Define TRACE constant", that the ".pdb" file was not needed.  But that is not the case.  So going forward to all whom run into this same issue.  Be sure to copy the new ".pdb" along with the new DLL every time!

And even better news is that we now have our first working demo to share with exec management...

Thanks to everyone that helped me with this issue, Carl, Ami, Ravi!

------------------------------
Leon
------------------------------