Vb6.ActiveX.Hosting
0.1.0
dotnet add package Vb6.ActiveX.Hosting --version 0.1.0
NuGet\Install-Package Vb6.ActiveX.Hosting -Version 0.1.0
<PackageReference Include="Vb6.ActiveX.Hosting" Version="0.1.0" />
<PackageVersion Include="Vb6.ActiveX.Hosting" Version="0.1.0" />
<PackageReference Include="Vb6.ActiveX.Hosting" />
paket add Vb6.ActiveX.Hosting --version 0.1.0
#r "nuget: Vb6.ActiveX.Hosting, 0.1.0"
#:package Vb6.ActiveX.Hosting@0.1.0
#addin nuget:?package=Vb6.ActiveX.Hosting&version=0.1.0
#tool nuget:?package=Vb6.ActiveX.Hosting&version=0.1.0
Vb6.ActiveX.Hosting
Host VB6 ActiveX DLL modeless and modal forms inside a .NET process. ComHost.Open() starts a dedicated STA thread and message pump (MTA callers are fine). You do not register an OLE message filter or pump messages yourself.
Windows-only. Classic 32-bit VB6 DLLs must be loaded from an x86 (or AnyCPU prefer-32-bit) process.
Install
dotnet add package Vb6.ActiveX.Hosting
Sync
using (ComHost host = ComHost.Open())
{
host.ModelessWindowOpened += (_, e) => { /* not on the host STA thread */ };
dynamic launcher = host.CreateInstance("YourLib.YourClass");
launcher.ShowNonModal();
}
CreateInstance (non-generic) returns a late-bound proxy: ShowModal / ShowNonModal run on the host STA thread, so a modal form can be closed with the title-bar close box or CloseWindows(). The host tracks each RCW and releases it on Dispose (or earlier via Release). Do not call Marshal.ReleaseComObject. CreateInstance<T> returns the raw RCW — call UI methods through Invoke / InvokeAsync.
Show vbModal blocks the caller until the form closes. From another thread, CloseWindows() or HostWindowEventArgs.Close() posts WM_CLOSE.
Async
await using (ComHost host = ComHost.Open())
{
await host.InvokeAsync(() =>
{
dynamic launcher = host.CreateInstance("YourLib.YourClass");
launcher.ShowModal();
});
}
InvokeAsync does not block the caller. await using calls DisposeAsync.
Options
ComHostOptions options = new ComHostOptions
{
EventContext = SynchronizationContext.Current, // WinForms/WPF UI thread
ShutdownTimeout = TimeSpan.FromSeconds(2),
Logger = logger,
};
using (ComHost host = ComHost.Open(options))
{
foreach (HostWindowInfo window in host.GetWindows())
{
_ = window.Title;
}
}
Activation failures throw ComHostException (ProgID/CLSID, HRESULT, regsvr32 hint). A 64-bit process throws PlatformNotSupportedException unless ThrowIf64BitProcess is false.
Requirements
- Windows, .NET Standard 2.0 or .NET 8+ Windows
- 32-bit process when loading 32-bit VB6 DLLs in-process
- The ActiveX DLL registered (
regsvr32from SysWOW64) or registration-free COM
Sample app and VB6 sources: github.com/jeromydean/VB6ComHost.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
-
net8.0-windows7.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 90 | 9/19/2026 |