Class wwDotnetCoreBridge

The wwDotnet Bridge class shares the same features as the wwDotnetBridge class but works against .NET Core 3.0 or later components. Like the full framework version wwDotnetCoreBridge hosts a copy of .NET Core and provides a class factory and proxy implementation to create instances and access features that COM does not natively expose.

The only difference between wwDotnetBridge and wwDotnetCoreBridge is how they are instantiated and most other features are identical. The instantiation is:

loBridge = CREATEOBJECT("wwDotnetCoreBridge")

For all features, please refer to the main wwDotnetBridge documentation.

Requires that .NET Core 3.x

This library requires that the 32 bit .NET Core 3.0 or 3.1 runtime is installed on the machine. It searches for the highest version available on the machine and uses that to host the .NET Core runtime. You can explicitly supply the host folder of the runtime as an option.

No .NET 5.0 Support currently

Due to changes in the .NET 5.0 (Core) runtime hosting mechanism, currently wwDotnetCoreBridge does not work with .NET 5.0.


There are no major differences between wwDotnetBride and wwDotnetCoreBridge. Once loaded you can expect the same behavior and member interface between the two. P


do wwDotNetBridge
LOCAL loBridge as wwDotNetBridge
loBridge = CREATEOBJECT("wwDotnetCoreBridge")

*** Should echo .NET Core version information
? loBridge.GetDotnetVersion()

*** Load a .NET Core Assembly
IF !loBridge.Loadassembly(".\NetCoreFromFoxPro\NetCoreFromFoxPro\bin\Debug\netcoreapp3.0\NetCoreFromFoxPro.dll")
   ? "Unable to load assembly: " + loBridge.cErrorMsg

loNet = loBridge.CreateInstance("NetCoreFromFoxPro.DotnetSamples")

? "*** Calling Hello World:"
? loNet.HelloWorld("rick")

? "*** Returning a Person"
loPerson = loNet.GetPerson()
? loPerson
? loPerson.Name
? loPerson.Company
? loPerson.Entered

? "*** Passing a Person"
loPerson.Company = "East Wind Technologies"
? loNet.SetPerson(loPerson)

*** Create a built-in .NET class and run a method
loHttp = loBridge.CreateInstance("System.Net.WebClient")

*** Get all the local User Certificates
loStore = loBridge.CreateInstance("System.Security.Cryptography.X509Certificates.X509Store")

? loBridge.cErrorMsg

*** Grab a static Enum value
leReadOnly = loBridge.GetEnumvalue("System.Security.Cryptography.X509Certificates.OpenFlags.ReadOnly")

*** Use the enum value
loStore.Open(leReadOnly)   && 0 - if value is known

*** Returns a .NET Collection of store items
laCertificates = loStore.Certificates

*** Collections don't work over regular COM Interop
*** so use indirect access
lnCount = loBridge.GetProperty(laCertificates,"Count")

*** Loop through Certificates
FOR lnX = 0 TO lnCount -1
	*** Access collection item indirectly using extended syntax
	*** that supports nested objects and array/collection [] brackets
	LOCAL loCertificate as System.Security.Cryptography.X509Certificates.X509Certificate2	
	loCertificate = loBridge.GetProperty(loStore,"Certificates[" + TRANSFORM(lnX) + "]")
	IF !ISNULL(loCertificate)
		? loCertificate.FriendlyName
		? loCertificate.SerialNumber
		? loCertificate.GetName()
		*? loBridge.GetPropertyEx(loCertificate,"IssuerName.Name")

Class Members

See also:

Class wwDotnetCoreBridge

© West Wind Technologies, 1996-2021 • Updated: 02/10/21
Comment or report problem with topic