CsCom.Build
4.1.0
dotnet add package CsCom.Build --version 4.1.0
NuGet\Install-Package CsCom.Build -Version 4.1.0
<PackageReference Include="CsCom.Build" Version="4.1.0" />
<PackageVersion Include="CsCom.Build" Version="4.1.0" />
<PackageReference Include="CsCom.Build" />
paket add CsCom.Build --version 4.1.0
#r "nuget: CsCom.Build, 4.1.0"
#:package CsCom.Build@4.1.0
#addin nuget:?package=CsCom.Build&version=4.1.0
#tool nuget:?package=CsCom.Build&version=4.1.0
CsCom.Build
CsCom.Build generates COM interop code during the build of a project, from the type libraries, ProgIDs, LIBIDs and .NET
interop assemblies that the project lists as CsComReference items. The generated C# uses the
source-generated COM interop
of .NET, so it can be trimmed and compiled with Native AOT. The package bundles the
cscom tool, which generates the code.
It needs Windows, .NET 10 or later and C# 14 or later, and a Windows-specific target framework such as net10.0-windows.
Usage
cscom reference add Scripting.Dictionary adds the package and the reference to a project, or add them yourself:
<ItemGroup>
<CsComReference Include="Scripting.Dictionary" />
<CsComReference Include="C:\Libs\Legacy.tlb" Namespace="Legacy.Interop" />
</ItemGroup>
The code is generated into the intermediate output before the compilation, again only when the references, the options or
the type libraries change. Each reference gets a namespace of its own: its Namespace metadata, or Interop.<Library>,
e.g. Interop.Scripting:
using Interop.Scripting;
IDictionary dictionary = Dictionary.Create();
dictionary.Add("apple", 3);
Console.WriteLine(dictionary.Count);
The options, such as the events, the marshalling and the support code, are item metadata and CsCom* properties.
With <CsComExportTypeLibrary>true</CsComExportTypeLibrary>, the package also exports the type library (.tlb) of the
[GeneratedComInterface] and [GeneratedComClass] types of the project after the compilation, like TlbExp.
Documentation
See cscom.fedarovich.com, starting with Getting started, MSBuild integration and Exporting type libraries.
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- CsCom.Runtime (>= 4.1.0)
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 |
|---|---|---|
| 4.1.0 | 102 | 11/25/2026 |
| 4.0.0 | 105 | 11/21/2026 |
| 4.0.0-rc.2 | 67 | 11/20/2026 |
| 4.0.0-rc.1 | 61 | 11/20/2026 |
| 3.0.0 | 109 | 11/13/2026 |
| 3.0.0-rc.1 | 67 | 11/13/2026 |
| 3.0.0-beta.2 | 64 | 11/13/2026 |
| 3.0.0-beta.1 | 69 | 11/13/2026 |
| 3.0.0-alpha1 | 95 | 11/12/2026 |
| 2.0.0 | 106 | 11/11/2026 |
| 2.0.0-beta.1 | 64 | 11/10/2026 |
| 2.0.0-alpha.1 | 72 | 11/2/2026 |
| 1.0.0 | 117 | 10/30/2026 |
| 1.0.0-beta.3 | 81 | 10/29/2026 |
| 1.0.0-beta.2 | 69 | 10/28/2026 |
| 1.0.0-beta.1 | 76 | 10/28/2026 |