On one deployment of our desktop app in the cloud, we get the wwDotNetBridge Error: Type not loaded error when it attempts to create a ComValue.
This is a cloud host that is using Windows 2012 to allow you to remote in and run the application. I have a test account and my install in the cloud works.
What could the cloud host not have configured correctly that we're getting this error?
Here's the code that gets the error:
loBridge = CREATEOBJECT("wwDotNetBridge", "V4")
loValue = loBridge.CreateComValue()
We have the latest version of wwDotNetBridge.dll installed as well as wwIPStuff.dll.
I'm not sure what to tell the cloud host to check.
-Phil
Not sure what that particular error means.
Make sure you have to the right versions of everything. Latest version of wwDotnetBridge.dll and wwipstuff.dll. Also, .NET 4.5
has to be installed on the server - I think 2012 still ships with 4.0 and 4.5 or later has to be explicitly installed.
+++ Rick ---
It has to be something with the server the cloud host set up. I've got a support ticket in with them waiting to see if .Net 4.5 is installed.
-Phil
I called the GetHighestDotNetVersion function and it returns 4.0.30319 which is the version of .net that my test cloud server has and that server works.
The full error message is: wwDotNetBridge Error: Type not loaded. Please call LoadAssembly first.
What else should I check?
-Phil
When in doubt do this in FoxPro:
DO wwDotnetBridge
loBridge = GetwwDotnetBridge("V4")
MessageBox(loBridge.GetDotnetVersion)
This will tell you if the app is able to load wwDotnetBridge just by itself.
FWIW the .NET Version for any version of .NET 4.0 will show that version which is fixed and will never change. The build number is what determines the actual version number.
But any version of .NET 4.0 and later should work, preferrably 4.5.2 and later and you definitely have that.
Specify the version number explicitly (ie. V4) and make very sure you have the right files from a common distribution (ie. wwipstuff and wwdotnetbridge as a matched set).
Here's more info: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
+++ Rick ---
Hey Rick,
Running that snippet of code returns
If I do
do wwDotNetBridge
GetHighestDotNetVersion()
it returns the 4.0.30319.
I'm specifiying the version "V4" in the creatobject of wwDotNetBridge. Why wouldn't it load the highest version?
-Phil
Check your config file and make sure that you don't have an override in there for a specific version of .net.
yourApp.exe.config
or
vfp9.exe.config
Runtime version can be specifically specified in there and it will override whatever you use.
More info here:
GetHighestDotnetVersion()
is old and no longer works reliably because they changed the way the runtimes are rev'd so that's not always reliable. If this is a desktop machine (ie. running desktop Windows) it might have the .NET 4.0 Client runtimes installed which existed only for 1 version. wwDotnetBridge can't load that one because it doesn't include some of the dependencies we load.
The best thing to do would be to install the latest version of .NET that you can get on the machine and see what happens.
+++ Rick ---