FoxPro and .NET Interop
Error when first running running the following wwDotNetBridge sample code
Gravatar is a globally recognized avatar based on your email address. Error when first running running the following wwDotNetBridge sample code
  Alejandro A Sosa
  All
  Jun 25, 2019 @ 01:48pm

When first running running the following wwDotNetBridge sample code I got this message.

*** Load dependencies and add to Procedure stack
*** Make sure wwDotnetBridge.prg wwDotnetBridge.dll wwIPStuff.dll 
*** are in your FoxPro path
DO wwDotnetBridge
InitializeDotnetVersion("V4") 

The error occurrs in the line:

		lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
				"Westwind.WebConnection.wwDotNetBridge",@lcError,@lnSize)

When I clicked the Yes button, it sent me to https://www.microsoft.com/en-us where there is no obvious action to take.

Neither wwDotnetBridge.dll or wwipconfig.dll are blocked.

Any suggestions?

TIA,

Alex

Gravatar is a globally recognized avatar based on your email address. re: Error when first running running the following wwDotNetBridge sample code
  Rick Strahl
  Alejandro A Sosa
  Jun 25, 2019 @ 02:36pm

Looks like you don't have .NET 4.5.2 or later installed perhaps? Seems unlikely but that's what the error message is pointing at... Make sure you have matched versions of wwIPStuff.dll and wwdotnetbridge.dll.

If you have Web Connection or Client Tools installed (recent versions) go to the \samples\wwDotnetBridge\wwDotnetBridgeTest folder. In there is an EXE that you can run that's been compiled with the current version of wwDotnetBridge and it gives you status information. If .NET 4.5+ is not not installed that won't run in which case you should download and install the latest version (.NET 4.8) from www.dot.net.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error when first running running the following wwDotNetBridge sample code
  Alejandro A Sosa
  Rick Strahl
  Jun 26, 2019 @ 08:40pm

Installed .NET 4.8.

Message from wwDotNetBridgeTest:

wwIpConfig and wwDotNetBridge are matched files (both from 11 Mar 2019)

Still same message when running this code:

*** Load dependencies and add to Procedure stack
*** Make sure wwDotnetBridge.prg wwDotnetBridge.dll wwIPStuff.dll 
*** are in your FoxPro path
DO wwDotnetBridge
InitializeDotnetVersion("V4") 

Would appreciate suggestions.

TIA,

Alex

Gravatar is a globally recognized avatar based on your email address. re: Error when first running running the following wwDotNetBridge sample code
  Rick Strahl
  Alejandro A Sosa
  Jun 26, 2019 @ 10:23pm

Not sure then. Try using the same DLLs that are used in the test. Perhaps the versions you're actually referencing in your app are older?

I'm not sure I understand what the error message means frankly. Is it possible that something else is starting a different version of the .NET runtime before you run this code? (ie. loading .NET 2.0 perhaps)

IAC if the test app works your system just works if you're using recent versions of wwDotnetBridge.dll. There have been changes recently that automatically unblock the dlls. Older versions didn't do this automatically.

+++ Rick ---

© 1996-2019