1. Vigneshkumar Elango
  2. PowerBuilder
  3. Thursday, 16 March 2023 07:18 AM UTC

I'm using PB 2021 version. I developed new dll using Csharp code. In that code we have a functionality to call the webservice. I have imported the dll using the .net import and done the run time build and deployed that to EXE. I have placed the new dll file in application folder. Its working in my machine in any path. But its not working in others machine. Even the source is not working in others machine who have the PB2021. So in every machine I have to import the dll manually..

Can anyone help on this ?

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 17 March 2023 13:03 PM UTC
  2. PowerBuilder
  3. # Permalink
In addition to Andreas great suggestion, don't forget that you'll need the .Net Core runtime on the deployment machines as well.
Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 17 March 2023 13:08 PM UTC
  2. PowerBuilder
  3. # 1

You can copy your compiled assembly in a subfolder in your pb application and then make your pb generated object see it using a relative path.

AppFolder/MyAssembly/<here put your assembly>.

Then change is_assemblypath to ./AppFolder/MyAssembly/<your assembly.dll>. Don't forget to add . before /AppFolder...

Another way is to GetCurrentDirectory when your application starts and hold it's returned value to a global variable. In this case is_assemblypath should get as value <apppath global variable>/AppFolder/MyAssembly/<your assembly.dll>.

Andreas.

Comment
There are no comments made yet.
Vigneshkumar Elango Accepted Answer Pending Moderation
  1. Friday, 17 March 2023 13:04 PM UTC
  2. PowerBuilder
  3. # 2

Question : String is_assemblypath is sets the path where the machine is creating the build. How to make this path dynamic ?

eg: In Build machine path is like D:user/task/app_source

is_assemblypath = "D:user/task/app_source"

My deployment machine have the exe in D:/app_1

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 16 March 2023 14:50 PM UTC
  2. PowerBuilder
  3. # 3

Just make sure you are aware that PB has HTTP client, JSON parser/generator, OAuth and JWT token support, etc. so there is no need to use a .NET DLL you can natively call virtually any Web service from PB directly.  By doing so you make your deployment configuration and dependecy simpler and avoid the kind of problems you are having. 

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 16 March 2023 10:01 AM UTC
  2. PowerBuilder
  3. # 4

Hi.

I guess that your generated object contains a full path defined for your assembly. Edit source the generated object and search for "String is_assemblypath" and check if it's value is a full path. If this is the case change it to a relative path (and place your assembly to the appropriate location).

Also, for deployments to end user pc's you need to deploy some additional runtime files. Check the documentation.

Andreas.

Comment
  1. Andreas Mykonios
  2. Thursday, 16 March 2023 13:41 PM UTC
You are right. .Net core runtime or .net framework depending on how the assembly was created - built.

Andreas.
  1. Helpful 1
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.