1. Aron Cox
  2. PowerBuilder
  3. Monday, 11 May 2020 11:20 AM UTC

Windows 10

PowerBuilder CloudPro 2019 R2 2328

No source control at the moment

 

I am finally getting round to seeing if I can move my C# Active/X wrapped dll to use the new PowerBuilder 2019 R2 C# handling feature.

Part of what I am looking at is how the PowerBuilder IDE and SnapDevelop integrate with each other. From looking at videos like this

https://www.youtube.com/watch?v=2Kl94wgh7Hs

it seems I should be able to create a new PowerBuilder workspace, add a PowerBuilder project, then add a C# project. Snap Develop will be loaded and I should be prompted to add the new solution to the PowerBuilder workspace, the System Tree will be updated to have a new project containing C# code, which I am assuming I can click on and launch SnapDevelop to see.

In my case SnapDevelop is launched, but I am not prompted to add the solution to the PB workspace, and the new project is not added to the System Tree in PowerBuilder.

Any ideas what I'm doing wrong? Can I manually add existing C# as a project to the PB workspace?

Here's the exact steps:

* Open up a PowerBuilder workspace, with a standard PowerBuilder application target already in it

* Click on the New toolbar button

* Select C# Projects

* Snapdevelop opens. Select a project type, set the name and folder and click on OK

At this point I am expecting to be prompted to add the new solution to the PB workspace. There is no prompt and SnapDevelop sits there with it's code, working just fine, just no link between the two projects.

Thank you!

 

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Monday, 11 May 2020 16:59 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Aron,

There are two ways to interop C# code with PowerBuilder. 

  1. One option is through REST APIs, which SnapDevelop can automatically generate a lot of the controllers and models.  Even for on-premise deployment, we still think this is the most flexible architecture.  Then you would call it using the RESTClient from PowerScript.

  2. The other option is to import the .NET DLL into your PowerScript code using the .NET DLL Importer.  This requires you deploy additional runtime DLLs and .NET framework (if not already installed) to each client machine.  The other thing is that your .NET DLL must comply with certain requirements.

There is no combining of projects into a single PowerBuilder application target.  A C# project and a PowerScript project are two separate projects, and in fact your C# project is following open standards so that it can be viewed/edited in any C# IDE (e.g. Visual Studio, etc.). 

In terms of IDEs included in a PowerBuilder subscription, here are the capabilities by IDE type:

  • PowerBuilder IDE
    • View/edit PowerScript projects
    • View/edit PowerServer projects
    • Import .NET DLLs (cannot view or edit the .NET source code)
  • SnapDevelop IDE
    • View/edit C# projects
    • View (not edit) PowerScript projects
    • Convert DataWindows to C# POCO Models (requires DataWindow Converter plugin)
    • Migrate PowerBuilder business logic to C# (requires PowerScript Migrator plugin)

The pricing table explains which products are bundled in various subscription levels.

Hope this clears up the confusion.

Regards,
Armeen

Comment
  1. Armeen Mazda @Appeon
  2. Monday, 11 May 2020 17:23 PM UTC
Yes, the icon in PowerBuilder is just a shortcut to open SnapDevelop for convenience.

We cannot combine them in a single workspace because there is not a single IDE that supports editing both PowerScript and C#.

We are definitely looking to enhance this in future versions, but you could create a wrapper for it to map how your .NET DLL is currently written to what PowerBuilder expects. Boolean and string is supported, and .NET Classes are supported as long as they comply with the requirements in the docs.
  1. Helpful
  1. Ricardo Jasso
  2. Monday, 11 May 2020 17:52 PM UTC
From a pure PowerBuilder developer view point it seemed a little odd to have an option that says "Generate C# Models" in the DataWindow context menu. I liked that it was removed from the PB IDE and moved to the SnapDevelop IDE. And for a C# Web API developer it makes more sense to access the export option from within SnapDevelop instead of having to return to the PB IDE, select the DW, export the model and then return back to SnapDevelop to continue working on the web API. Plus, being able to view all the PowerScript code of a PB target sure is very convenient for someone looking to migrate business logic to C#.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Monday, 11 May 2020 18:02 PM UTC
Hi Ricardo, glad you like the change we made.
  1. Helpful
There are no comments made yet.
Ricardo Jasso Accepted Answer Pending Moderation
  1. Monday, 11 May 2020 14:22 PM UTC
  2. PowerBuilder
  3. # 1

Several important changes were made from the version of PowerBuilder in that video (2019) to the current version (2019 R2) regarding C# Web APIs development with SnapDevelop. I'd suggest you search for a more recent video or read the most current documentation.

Comment
  1. Aron Cox
  2. Monday, 11 May 2020 15:03 PM UTC
Thanks, maybe that's the issue. I've been having trouble finding details on how it's all supposed to work, especially as I'm not interested in web services right now. The idea of having my C# code visible in the same IDE as my PowerBuidler code sounded pretty interesting. I will keep searching.
  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.