FoxPro and .NET Interop
Access to DotNetBridge from Azure server
Gravatar is a globally recognized avatar based on your email address. Access to DotNetBridge from Azure server
  Bob
  All
  Nov 6, 2019 @ 06:53pm

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
Gravatar is a globally recognized avatar based on your email address. re: Access to DotNetBridge from Azure server
  Rick Strahl
  Bob
  Nov 7, 2019 @ 11:18am

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

© 1996-2019