1. Jeganathan Thasaiyan
  2. PowerBuilder
  3. Monday, 25 September 2023 08:37 AM UTC

The assembly binding is not working with .NET Dll import. Any suggestions for this?

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 25 September 2023 15:57 PM UTC
  2. PowerBuilder
  3. # 1

@Francisco,

Hi,

There's some confusion going on, please see:

https://community.appeon.com/index.php/qna/q-a/pb-2022-r2-net-6?limitstart=0#reply-42155

and quoting Peter Pang:

"PB2022 R2:
DLL of .Net framework/.Net Core/.Net x(5,6) can be imported by using .NET DLL Importer. Because it is forward compatible, the original distinction option has been removed.
But after being imported, the LoadWithDotNet function is used by default, which can load normally. If you are worried about compatibility problems, you can also manually change to LoadWithDotnetFramework.

https://community.appeon.com/index.php/qna/q-a/snapdevelop-powerbuilder-net-confusion

"

It's really a shame if .Net Framework DLLs would stop to work, since not all is easily convertible to .Net, especially if you have third party libraries.

Some of our stuff is easily converted and other things are nearly impossible unless we hire some kind of an expert, making migration more difficult and expensive..

regards

 

Comment
  1. Jeganathan Thasaiyan
  2. Thursday, 28 September 2023 09:30 AM UTC
If I create new config file with name <pb application exename>.exe.config and include the assembly binding, it has started working.



For example, If I add below configuration into pbtest.exe.config file and place it on the same folder where exe is present, it works. Is this correct?





<configuration>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />

</dependentAssembly>

</assemblyBinding>

</runtime>

</configuration>

  1. Helpful 1
  1. Jeganathan Thasaiyan
  2. Thursday, 28 September 2023 11:31 AM UTC
Can I get an update for this from Appeon Support? Should I log any ticket for this? Can anyone suggest?
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 28 September 2023 14:25 PM UTC
Please open a support ticket.
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 September 2023 14:55 PM UTC
  2. PowerBuilder
  3. # 2

Hi Jeganathan,

 

PowerBuilder 2022 R2 and later supports .NET only (.NET Framework and .NET Core have been removed since Version 2022 R2).

Please see these two documentation pages.

 

Regards,
Francisco

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 25 September 2023 10:02 AM UTC
  2. PowerBuilder
  3. # 3

Version of PB?

.Net Core or .Net Framework?

 

Comment
  1. Jeganathan Thasaiyan
  2. Monday, 25 September 2023 11:02 AM UTC
yes I use LoadWithDotNetFramework in of_CreateOnDemand() function.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 25 September 2023 11:17 AM UTC
hmm, I'm not an expert on this, but maybe this can give you some idea?

https://stackoverflow.com/questions/3490327/assembly-binding-redirect-does-not-work

and maybe you can get more information by running "fuslogvw.exe" or this tool that is a better version of it: https://github.com/awaescher/Fusion

good luck!
  1. Helpful
  1. Jeganathan Thasaiyan
  2. Monday, 25 September 2023 13:00 PM UTC
Even the .NET application uses the assembly binding in the calling application then only there wont be any runtime errors.

In our case, since the PB application is the calling application and there is no config file, not sure how to do it.



Can I get any support from Appeon team on this?
  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.
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.