Click or drag to resize

EngineFactoryCreateAsync Method (EngineOptions)

Asynchronously creates and returns an IEngine instance.

Namespace:  DotNetBrowser.Engine
Assembly:  DotNetBrowser.Core (in DotNetBrowser.Core.dll) Version: 2.25.1
Syntax
C#
public static Task<IEngine> CreateAsync(
	EngineOptions options
)

Parameters

options
Type: DotNetBrowser.EngineEngineOptions
The EngineOptions instance that will be used for initializing the engine

Return Value

Type: TaskIEngine
A task which returns an initialized Chromium engine on completion. The task can throw EngineInitializationException if the IEngine initialization has failed for some reason.
Examples
Create IEngine
string dataDir = TestUtil.GenerateCustomFolderPath();
Debug.WriteLine($"Data directory: {dataDir}");
Directory.CreateDirectory(dataDir);

EngineOptions engineOptions = new EngineOptions.Builder
    {
        UserDataDirectory = dataDir
    }
   .Build();
IEngine engine = await EngineFactory.CreateAsync(engineOptions);
See Also