InitializeDotnetCoreVersion

Use this function in your application's startup program to force the 32 bit .NET Core Runtime version to be used by wwDotnetBridgeCore for the entire application. This loads the runtime and thus determines the runtime that will be used for the entire application making calls with wwDotnetBridgeCore.

FoxPro uses the 32 bit .NET Core Runtimes

Important: FoxPro is a 32 bit application and so it needs to run the 32 bit version of the .NET Core Runtimes or SDK. The 32 bit versions are separate and non-default installations of the .NET Core runtime, and they are installed in:
c:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\

To load the .NET Core version of wwDotnetBridge that loads the latest installed version of the .NET Core Runtime:

InitializeDotnetCoreVersion()         && highest version

or to specify a specific version:

InitializeDotnetCoreVersion("6.0.1")

or the highest installed version for the provides version part:

InitializeDotnetCoreVersion("6.0")   && loads highest 6.0.x version

InitializeDotnetCoreVersion("6")   && loads highest 6.x.x version

or you can specify an explicit runtime folder:

InitializeDotnetCoreVersion("C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\5.0.17")

The 32 bit .NET Core Runtime version you specify - either implicitly or explicitly - has to be installed on the machine.

Important

This is an important feature and we highly recommend you add the above line of code to the startup code of every application that uses wwDotnetBridgeCore.

Why do this?

Calling this method forces the .NET Core Runtime version to a specific version. You are explicitly setting the .NET Core version that's used by wwDotnetCoreBridge throughout your application, so any attempt to create a new instance of wwDotnetCoreBridge always creates an instance in this same runtime version.

Each application can host only a single instance of the .NET Core Runtime and this function sets the version.

InitializeDotnetCoreVersion(lcVersion)

Parameters

lcVersion
Optional - allows you to specify the Runtime version. By default uses the highest installed system 32 bit .NET Core Runtime. You can specify:

  • 32 bit .NET Core Runtime Version Number: "5.0.15"

  • Runtime Folder Location
    This allows you to potentially use a private .NET Core Runtime installation that ships with your application, or points at another location or application that has the runtime installed.

Remarks

Static Function

This is a static function, not a method of wwDotnetBridge

Version Support

This version supports 32 Bit .NET Core Runtimes for version 3.1, 5.0, 6.0 and later.


See also:

Class wwDotNetBridge

© West Wind Technologies, 1996-2023 • Updated: 01/12/23
Comment or report problem with topic