1. Aron Cox
  2. PowerBuilder
  3. Thursday, 28 December 2023 06:31 AM UTC

My PC died so I had to build a new one. On my old PC I could import my .NET assembly into a PBL using the .NET Dll Importer tool, then debug to the line that actually calls the method in the assembly, and press F8 to step into SnapDevelop and start debugging the C# code.

Now, on my new PC, when I press F8 to step into the C# code one of two things happens:

  1. It just steps onto the next line of code in PowerBuilder and the result from calling the assembly has been successfully returned
  2. It launches SnapDevelop, but doesn't open the debugger and just comes back to the next line of code in PowerBuilder. I can;t see any error messages in SnapDevelop just a lit of Loaded assemblies in the Debug output, with the last assembly being mine

I'm not sure why it does option one for some methods / classes and option 2 for others.

I have made sure the "Launch SnapDevelop to debug C# assemblies" is checked in System Options.

I have tried this with the following combinations:

Assembly in .NET 6.0 and .NET Framework 4.8.1. PowerBuilder 2019 R3 and 2022 R3 Beta. Compiling the assembly with Visual Studio 2022 and SnapDevelop 2019 and 2022. On a colleague's PC, not working there either. I am running Windows 10, fully updated via Windows Update.

I know this was working on my old PC. Anyone have any ideas as to what I'm doing wrong? Of course my old PC had a ton of extra stuff installed, so maybe I am missign something on my new PC???

Thanks!

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 28 December 2023 12:18 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

I've imported several .Net Framework dlls and they all blow up when putting debug stops on them.

pb2019 R3.

If you put the stops before or after the .Net stuff, things work well.

 

Comment
  1. Miguel Leeuwe
  2. Friday, 29 December 2023 08:24 AM UTC
Ah okay sorry ..., you use SnapDevelop for the debugging instead of Visual Studio. I use Visual Studio and as long as the DLL has been compiled for debug at least that part goes well. (meaning I can put a stop in VS and the debug process goes "fairly" well, as it might also blow up coming back to the PB call).
  1. Helpful
  1. Aron Cox
  2. Saturday, 30 December 2023 03:07 AM UTC
Ah interesting, yeah I havn't tried too hard with Visual Studio. Once I got SnapDevelop to work automatically without having to attach to the process I was happy with using it as the debugger.

My issue with SnapDevelop seems to be: on the first step into SnapDevelop is launched and I can debug, then if I make another call from PowerBuilder into a different dll it hangs, unless I close the SnapDevelop that was previously launched first. Needs more experimentation, but that seems to be an issue.

I also wonder why I needed PowerBuilder 2021 installed and why SnapDevelop 2021 launches from PowerBuilder 2019, and why PowerBuilder 2022 R3 Beta didn't work. It's all a little flaky. May have to try installing PowerBuilder 2022 non-beta next.
  1. Helpful
  1. Miguel Leeuwe
  2. Saturday, 30 December 2023 06:51 AM UTC
Yes, I think you're absolutely right by using the word "flaky". The biggest issue for me is that I cannot debug from powerbuilder code when running the DLL function calls. Hopefully it'll improve.

regards
  1. Helpful
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Thursday, 28 December 2023 09:08 AM UTC
  2. PowerBuilder
  3. # 2

UPDATE

I installed PowerBuilder 2021 and Visual Studio 2019, as I knew I had those on my old PC. Then I built the .NET Framework 4.8.1 assembly in Visual Studio 2019, and ran my test code in PowerBuilder 2019. It now works as it used to, SnapDevelop is launched and the debugger starts!

Now I will test with various other versions.

Comment
  1. Aron Cox
  2. Thursday, 28 December 2023 09:47 AM UTC
.NET 6.0 assembly compiled using Visual Studio 2022, called from PowerBuilder 2019 R3 also works. SnapDevelop 2021 is started and enters debug.



So it seems to me the solutions was to install PowerBuilder 2021???



I'lldo more testing in the New Year.
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 28 December 2023 07:24 AM UTC
  2. PowerBuilder
  3. # 3

Hi.

Please clarify if your assembly on the new pc has been compiled in debug mode. Also, in the folder containing your assembly do you have a pdb file?

Andreas.

Comment
  1. Aron Cox
  2. Thursday, 28 December 2023 08:05 AM UTC
Thanks for your help. Yes, it was an x86 debug build, and there is a PDB file
  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.