1. Guy Shavit
  2. PowerBuilder
  3. Tuesday, 6 September 2022 14:43 PM UTC

I've installed a trial version of PowerBuilder 2019 R2.

The project I'm working on loads a .Net dll.

For some reason I keep getting a -2 return code when using LoadWithDotNetFramework, both when using relative and absolute paths. My colleagues are running the same project but this function works fine when they use it. Is it possible that this is caused due to the fact that I'm using a trial version and they're Not?

Accepted Answer
Guy Shavit Accepted Answer Pending Moderation
  1. Wednesday, 7 September 2022 09:04 AM UTC
  2. PowerBuilder
  3. # Permalink

Problem solved.

It seems that in 2019 R2 you need to import the dll file and recreate the nvo object on your workstation. After that you can delete the newly created nvo and use the one that already existed in the project.

Does this write the dll in the registry or someplace similar for the project to find it?

This situation did not happen when we ran the project on version 2019 R3

Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 7 September 2022 16:32 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 September 2022 16:52 PM UTC
  2. PowerBuilder
  3. # 1

Hi Guy,

Do you have the appropriate .NET Framework Runtime version installed on your machine? What version of the .NET Framework Runtime do you have installed? You can check this by going to this registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full)

Regards,
Francisco

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 6 September 2022 15:29 PM UTC
  2. PowerBuilder
  3. # 2

I doubt this is due to you using a trial version of PB.

A return code of -2 means that PB could not find the assembly. Compare your environment with one(s) that work; Ensure the assembly is accessible to the application. If running from the IDE, the assembly likely needs to reside in the same folder as the PB target, or in a folder that is listed in the system PATH environment variable. Do it the same way the others do.

Comment
  1. Guy Shavit
  2. Tuesday, 6 September 2022 15:36 PM UTC
As I've mentioned, I've tried this both, using a relative and an absolute path and the results are the same. While debugging the code I saw where the IDE is looking for the dll, but even though it's located there, I still get a -2 error code.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 September 2022 15:20 PM UTC
  2. PowerBuilder
  3. # 3

No, trial version wouldn't be the issue.

Are you on same build # as your colleague?

Do you have correct version of .NET that the DLL requires?

Comment
  1. Guy Shavit
  2. Tuesday, 6 September 2022 15:27 PM UTC
Yes, we all have the same build.

As for .Net version, we're using SnapDevelop and I have no problem compiling the source code of the dll to create a version of my own, so I guess that's not the problem (unless I'm missing something)
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 6 September 2022 21:22 PM UTC
Did you compile the DLL as framework dependent or self contained?
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.