Just ideas:
1) compile with a different version of .net: try 4.5.1 or 4.7.x (.net core?)
In the help file, "about c# assembly", you'll find this information:
The C# assembly supported by PowerBuilder must be developed on .NET Framework 4.0 or later or .NET Standard 1.0 or later. And the assembly DLL file will require the corresponding version of .NET Framework to run, especially if the DLL file is a .NET Standard class library. Please check the Microsoft website or the following table for the compatible versions between .NET Standard and .NET Framework.
.NET Standard |
1.0 |
1.1 |
1.2 |
1.3 |
1.4 |
1.5 |
1.6 |
2.0 |
.NET Framework |
4.5 |
4.5 |
4.5.1 |
4.6 |
4.6.1 |
4.7.2 |
4.7.2 |
4.7.2 |
4.0 is missing in this table. Also I've tried 4.7.1 and that worked. I find the whole compatibility thing quite confusing to be honest.
2) in the assembly, do not mark the dll as COM visible. I only did a small test so far and did not mark the DLL as com visible and it worked. I'm not sure if that's important though.
- that's all I can think of