FoxPro and .NET Interop
Access to DotNetBridge from Azure server
When I run this using RDS from an Azure server the create instance returns .null If I run it from a local drive, loMsg returns an object. I can't really tell if the assembly loaded in the first instance, but I do know the CreateInstance is failing.
If "Z"$oApp.s_modules &&running on azure
g_needdotnet=.F.
If File("\\tsclient\c\trustcommerce\ipalink\IPA.Core.IPALink.exe")
?loBridge.LoadAssembly("\\tsclient\c\trustcommerce\ipalink\IPA.Core.IPALink.exe")
loMsg=loBridge.CreateInstance("IPA.Core.IPALink.Integration")
*2019.11.06
MESSAGEBOX(lomsg)
ELSE
*2019.11.06
MESSAGEBOX("file not found")
Endif
Else &&running local
g_needdotnet=.F.
If File("c:\trustcommerce\ipalink\IPA.Core.IPALink.exe")
?loBridge.LoadAssembly("c:\trustcommerce\ipalink\IPA.Core.IPALink.exe")
loMsg=loBridge.CreateInstance("IPA.Core.IPALink.Integration")
Endif
Endif
Most likely you're hitting the default network restrictions of .NET - you need to enable networks loading policy.
As to error trapping - LoadAssembly()
will return .t.
or .f.
and set .cErrorMsg
with a message for the failure.
+++ Rick ---