WinFormsComInterop 0.5.0

dotnet add package WinFormsComInterop --version 0.5.0                
NuGet\Install-Package WinFormsComInterop -Version 0.5.0                
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="WinFormsComInterop" Version="0.5.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WinFormsComInterop --version 0.5.0                
#r "nuget: WinFormsComInterop, 0.5.0"                
#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.
// Install WinFormsComInterop as a Cake Addin
#addin nuget:?package=WinFormsComInterop&version=0.5.0

// Install WinFormsComInterop as a Cake Tool
#tool nuget:?package=WinFormsComInterop&version=0.5.0                

ComWrappers required to run NativeAOT and WinForms

This repository has ComWrappers implementation for WinForms. In additional to that, it allow use WinForms and NativeAOT and R2R with trimming together.

Getting started

Just add WinFormsComInterop to your project.

dotnet add package WinFormsComInterop

Then to your Program.cs add following line

ComWrappers.RegisterForMarshalling(WinFormsComInterop.WinFormsComWrappers.Instance);

And modify project file to enable NativeAOT

<PublishAot>true</PublishAot>
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>

If you application will works with this ComWrappers implementation, then most likely it would work with NativeAOT.

If you are using WebView2 using Microsoft.Web.WebView2.Core package, then use

ComWrappers.RegisterForMarshalling(WinFormsComInterop.WebView2.WebView2ComWrapper.Instance);

Also

  1. Add <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1462.37" /> as depedency. This library would work only starting from this version of WebView2 package.
  2. Add RD.xml file from https://github.com/kant2002/RdXmlLibrary/blob/main/Microsoft.AspNetCore.Components.Web.rd.xml to project
  3. Add <RdXmlFile Include="Microsoft.AspNetCore.Components.Web.rd.xml" /> to project file
  4. Make sure that RootComponets are added to you app-specific rd.xml
<?xml version="1.0" encoding="utf-8" ?>
<Directives>
  <Application>
    <Assembly Name="YourAppAssembly" Dynamic="Required All">
      <Type Name="YourAppAssembly.YourRootComponent" Dynamic="Required All" />
    </Assembly>
  </Application>
</Directives>
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on WinFormsComInterop:

Repository Stars
AntdUI/AntdUI
👚 基于 Ant Design 设计语言的 Winform 界面库
Version Downloads Last updated
0.5.0 7,158 6/16/2024
0.4.3 4,533 1/18/2023
0.4.2 443 12/23/2022
0.4.1 333 12/23/2022
0.4.0 311 12/23/2022
0.3.2 2,466 10/23/2022
0.3.1 405 10/23/2022
0.3.0 489 9/3/2022
0.2.9 727 7/21/2021
0.2.8 463 7/15/2021
0.2.7 338 7/11/2021
0.2.6 320 6/17/2021
0.2.5 327 6/15/2021
0.2.4 357 6/11/2021
0.2.3 334 6/9/2021
0.2.2 321 6/4/2021
0.2.1 380 6/4/2021
0.2.0 348 6/3/2021
0.1.0 401 5/29/2021