1. Anoop Chaurasia
  2. PowerBuilder
  3. Monday, 22 January 2024 11:01 AM UTC

Hi,

I am facing issue with self-contained .net DLL. in the documents it is mentioned that using self contained DLLs will not require .net runtime to be installed on the target system, but when i am running the application, it is expecting the runtime.

Below is my code.

anv_object = CREATE DotNetAssembly;
anv_controls = create DotNetObject
//attempt to connect to ole object
try
li_rc = anv_object.LoadWithDotNet(as_dll); if isnull(li_rc) then li_rc = 0
li_rc = anv_object.createInstance(as_class, anv_controls)

 

It is returning -1 in error.

Please assist with this.

 

Thank You,

Anoop

Anoop Chaurasia Accepted Answer Pending Moderation
  1. Thursday, 25 January 2024 18:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi Francisco,

 

1. I am not getting any error actually, below is my code. This is working perfectly fine in dev environment, error is on the server where i am accessing the powerserver application.

2. Target Framework is net6.0-windows

3. I am not importing DLL, directly loading on application using below code.

 

anv_object = CREATE DotNetAssembly;
anv_controls = create DotNetObject
//attempt to connect to ole object
try
li_rc = anv_object.LoadWithDotNet(as_dll);
if li_rc < 0 then
    ls_error_header = "Unable to load .NET Assembly: "+as_dll
    ls_error_body = anv_object.ErrorText
else
    li_rc = anv_object.createInstance(as_class, anv_controls)
if li_rc < 0 then
    ls_error_header = "Unable to create instance of class: "+as_class
    ls_error_body = anv_object.ErrorText
end if
end if

if li_rc < 0 then
inv_error.of_message(is_appname, ls_error_header + '. Error: ' + ls_error_body + ', Please contact support for further assistance at ' + is_appphone+'.')
if ab_destroy then
destroy anv_object
destroy anv_controls
end if
return false
end if

 

and this is the message i am getting:

Unable to load .NET Assembly: MVE_GUI_Controls.DLL. Error: , Please contact support for further assistance at X-XXX-XXX-XXXX.

Comment
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Monday, 22 January 2024 16:35 PM UTC
  2. PowerBuilder
  3. # 2

Hi Anoop,

 

You are getting error -1, but what are the contents of is_errorText?

Additionally, what target framework is the DLL you're tying to import targeting?

 

Regards,
Francisco

Comment
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.