Could not load file or assembly 'file:///d:\jeffwork\wwdotnetbridge\testoib\bin\jefftestclass.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Here's my FoxPro Code:
do wwDotNetBridge
LOCAL loBridge as wwDotNetBridge
loBridge = CreateObject("wwDotNetBridge","V4")
? loBridge.LoadAssembly("bin\JeffTestClass.dll")loOib = loBridge.CreateInstance("HelloWorld")
IF ISNULL(loOib)
? loBridge.cErrorMsg
RETURN
ENDIF? loBridge.InvokeMethod(loOib,"Connect","")
*?loOib.Disconnect();
release loOibreturn
Here's my C# code:
using System;
using System.Collections.Generic;
using System.Text;namespace JeffTestClass
{
public class HelloWorld
{
public string Connect(string optionalWhatever)
{
return "HELLO WORLD";
}
}
}
I've got my C# project set to .NET Framework 4.0 and 32 bit.
Thanks...
Got it figured out. Had to exit VFP for some reason.
*** Load lib
DO wwDotnetBridge*** create an instance to force the .NET runtime to load
*** with specified version
GetwwDotNetBridge("V4")
Only the first load laods the runtime, so if your app somewhere loads a V2 runtime, and then later wants to load V4 dll it won't work.
Always, always force the .NET runtime on startup to ensure you the version you expect to use which should be the highest that is required ("V4" is recommended).
+++ Rick ---
Nevermind...
Got it figured out. Had to exit VFP for some reason.