FoxPro and .NET Interop
Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
Gravatar is a globally recognized avatar based on your email address. Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Michael J. Babcock
  All
  Nov 10, 2017 @ 01:19pm

Tried moving a simple VFP9SP2 EXE that works fine on my machine to a different machine (remote from me) where I already had a working VFP9SP2 EXE complete with the runtime files. I moved my EXE, its INI, and the ClrHost.dll, wwDotNetBridge.xml, wwDotNetBridge.dll, and a C# file name Onboarding.dll that's used as a go-between for a webservice call. I get this error though when trying to run it: https://www.screencast.com/t/yRQ04qhs4C

My machine is Win7Pro. This remote machine is a Windows 2003 server. I've right-clicked the files to see if there was an Unblock but apparently Win2003Server is too old for that security measure.

Is this because Win2K3 is too old? Or do I need to rebuild the C# piece with a lower (older) DotNet version?

Thanks! --Mike

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  Michael J. Babcock
  Nov 10, 2017 @ 08:51pm

The latest version of wwDotnetBridge does not work on XP and therefore I presume it also won't work on Server 2003. You can try it though - make sure you install .NET 4.0 on the machine, and then try using either V4 or V2 to load wwDotnetBridge on the server.

You can check with:

DO wwDotnetBridge
loBridge = CREATEOBJECT("wwDotnetBridge","V4")
MessageBox(loBridge.GetDotnetVersion())

and or (make sure you restart):

DO wwDotnetBridge
loBridge = CREATEOBJECT("wwDotnetBridge","V2")
MessageBox(loBridge.GetDotnetVersion())

The latest version of the client tools ships with an older version as wwDotnetBridge_XP.dll which you can use on XP and presumably on Server 2003 by renaming the XP version to wwdotnetbridge.dll. The older version is compiled with .NET 2.0 (and it can load most 4.0 assemblies), while the newer version is compiled for 4.0.

Pre version 6.x shipped the old wwDotnetBridge assembly that works on XP/2003, but with V6 and later I switched to compiling with .NET 4.0 as that's required for being able to load various newer .NET assemblies that otherwise wouldn't load. It's more important that new stuff works rather than very old stuff 😃

Let me know what you find. I can't remember all the details only that I tried a bunch of stuff trying to make the new code work on XP and was unsuccessful even though 4.0 should run on XP.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Michael J. Babcock
  Rick Strahl
  Nov 11, 2017 @ 05:19am

Thanks for the quick reply, Rick!

They've already got the 4.0 runtimes installed apparently. I did try the V2 parameter but no better.

We're upgrading that client's server to 2012 soon so we'll just wait for then.

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  Michael J. Babcock
  Nov 12, 2017 @ 09:33pm

What about using the older DLL? That should work both for 2.0 and 4.0.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Eric Selje
  Rick Strahl
  Feb 5, 2018 @ 07:50pm

I cloned the Git repo (v. 6.15) and it also failed. Checked but there was no "Unblock" option. Tried the PowerShell script anyway with no luck. Downloaded the .zip file from the repo and then did have to Unblock, but still no luck. Verified .Net framework versions and all other suggestions I could find.

Just found an older version (6.10) and tried that and it worked fine.

Eric

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  Eric Selje
  Feb 7, 2018 @ 12:29pm

Yes that's because we have dependencies on .NET 4.5 and .NET 4.5 doesn't run on XP and Server 2003. It should work on Vista and 2008 forward.

The older versions explicitly were compiled with .NET 2.0 which worked with older versions and 4.0, but which doesn't work with 4.5+ versions. So at this point I had to roll forward to support the latest features of .NET up to .NET 4.7.

The client tools ship with a wwdotnetbridge_xp.dll that you can use if you strictly want to stick with .NET 2.0/4.0.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  Eric Selje
  Feb 8, 2018 @ 02:28pm

Can you give that dll a try and see if that works? I don't have an easy way to test this any longer.

I'm not sure at this point whether it's the wwdotnetbridge.dll that's the issue (because we have references to other assemblies that are .NET 4.5+) or whether it's the recompiled wwipstuff.dll that uses the latest VC runtime libraries that just might not be there on XP or 2003.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  MarshalR
  Rick Strahl
  Mar 2, 2018 @ 12:16am

Getting the same Error Message on a Windows 7 64 Bit Pro with Version 6.1.17

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  MarshalR
  Rick Strahl
  Mar 2, 2018 @ 04:23pm

Thanks for your reply Rick.

Have checked the link.

Not Blocked and not running from a Network Share.

Can you please clarify: "To verify this issue check the \Windows\Microsoft .NET\Framework folder and check what versions are actually installed on the target system". What am I looking for? and if something's missing how do I install what's missing?

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  MarshalR
  MarshalR
  Mar 2, 2018 @ 04:28pm

Here's my V4.0.30319 Folder

See a File named clr.dll dated 12/15/17 - is this what I'm looking for?

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  MarshalR
  Mar 3, 2018 @ 01:37pm

Unfortunately you can't easily tell by the file status - you have to go look in the registry as outlined in the help topic at the bottom.

https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

And here is the topic again which has a few updates:

Also make sure you have matched versions of wwIpStuff.dll and wwDotnetBridge.dll from the same distribution - older versions of the wwipstuff.dll will not load the newer version of because of the runtime differences.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  MarshalR
  Rick Strahl
  Mar 3, 2018 @ 04:08pm

Thanks Rick for your reply.

My Error was CD-ing into the Classes Folder instead of the Main Unzipped Folder which contained wwIPStuff.dll and wwDotNetBridge.dll

FYI, ran your check program:

DO wwDotnetBridge

loBridge = CREATEOBJECT("wwDotnetBridge","V4")

MessageBox(loBridge.GetDotnetVersion())

and got the Result:

Gravatar is a globally recognized avatar based on your email address. re: Unable to load wwDotNetBridge: Unable to load Clr instance [Win 2003 Server]
  Rick Strahl
  MarshalR
  Mar 3, 2018 @ 11:11pm

Great!

Yeah generally it shouldn't be this hard. Paths are important...

I believe 42000 is .NET 4.7.1 which is the latest.

+++ Rick ---

© 1996-2024