-
Anoop Chaurasia
- PowerBuilder
- 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
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.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.