Majorsilence.Forms.WindowsFormsInterop 26.0.52

dotnet add package Majorsilence.Forms.WindowsFormsInterop --version 26.0.52
                    
NuGet\Install-Package Majorsilence.Forms.WindowsFormsInterop -Version 26.0.52
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Majorsilence.Forms.WindowsFormsInterop" Version="26.0.52" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Majorsilence.Forms.WindowsFormsInterop" Version="26.0.52" />
                    
Directory.Packages.props
<PackageReference Include="Majorsilence.Forms.WindowsFormsInterop" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Majorsilence.Forms.WindowsFormsInterop --version 26.0.52
                    
#r "nuget: Majorsilence.Forms.WindowsFormsInterop, 26.0.52"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Majorsilence.Forms.WindowsFormsInterop@26.0.52
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Majorsilence.Forms.WindowsFormsInterop&version=26.0.52
                    
Install as a Cake Addin
#tool nuget:?package=Majorsilence.Forms.WindowsFormsInterop&version=26.0.52
                    
Install as a Cake Tool

Majorsilence.Forms.WindowsFormsInterop

Migrate a WinForms application one screen at a time, instead of all at once.

A Windows-only bridge that lets real System.Windows.Forms forms and Majorsilence.Forms forms live in the same process, in both directions. On Windows, Avalonia's Win32 backend shares the existing Win32 message pump, so both toolkits are serviced by a single Application.Run — no second thread and no second message loop.

That makes an incremental migration practical: port the screens that matter, keep the rest on real WinForms, and ship working software the whole way through. When every screen is over, drop this package and the app is cross-platform.

Windows-only by definition — System.Windows.Forms does not exist on macOS or Linux. Off Windows it builds as an empty placeholder assembly so a cross-platform solution still compiles everywhere; calls throw PlatformNotSupportedException at runtime.

Install

dotnet add package Majorsilence.Forms.WindowsFormsInterop

Direction A — open a legacy WinForms form from a Majorsilence.Forms app

using Majorsilence.Forms.Interop;

WindowsFormsInterop.Show (new LegacyReportForm ());                  // modeless
var result = WindowsFormsInterop.ShowDialog (new LegacySettingsForm ());

Direction B — open a Majorsilence.Forms form from an existing WinForms app

Call InitializeMajorsilence() once in Program.Main, after WinForms initializes:

using Majorsilence.Forms.Interop;

WindowsFormsInterop.InitializeMajorsilence ();

// … later, from a WinForms event handler:
WindowsFormsInterop.ShowMajorsilenceForm (new NewDashboardForm ());

Call these on the UI (STA) thread. From a background thread, marshal first:

Majorsilence.Forms.Application.RunOnUIThread (() => WindowsFormsInterop.Show (form));

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
26.0.52 77 9/12/2026
26.0.51 104 8/30/2026
26.0.50 106 8/29/2026