whfmt.Formats
1.0.0
dotnet add package whfmt.Formats --version 1.0.0
NuGet\Install-Package whfmt.Formats -Version 1.0.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="whfmt.Formats" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="whfmt.Formats" Version="1.0.0" />
<PackageReference Include="whfmt.Formats" />
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 whfmt.Formats --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: whfmt.Formats, 1.0.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.
#:package whfmt.Formats@1.0.0
#: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=whfmt.Formats&version=1.0.0
#tool nuget:?package=whfmt.Formats&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
whfmt.Formats
856 binary format definitions (.whfmt) shipped as AdditionalFiles — ready to pair with whfmt.SourceGenerator for zero-CLI, compile-time C# parsers.
Quick start
1. Install both packages
<PackageReference Include="whfmt.Formats" Version="1.0.0" />
<PackageReference Include="whfmt.SourceGenerator" Version="1.0.0" />
That's it. At compile time, every format in this package is passed to whfmt.SourceGenerator as an AdditionalFile and a strongly-typed C# parser class is emitted automatically.
2. Use a generated parser
// WhfmtFormats.Images namespace — from Formats/Images/PNG.whfmt
var png = PngParser.ParseFile("photo.png");
Console.WriteLine(png.Width);
Console.WriteLine(png.Height);
// WhfmtFormats.Audio namespace — from Formats/Audio/MP3.whfmt
var mp3 = Mp3Parser.ParseFile("track.mp3");
Console.WriteLine(mp3.SyncWord);
Included categories
| Namespace | Category | Formats |
|---|---|---|
WhfmtFormats.ThreeD |
3D | ~24 |
WhfmtFormats.Archives |
Archives | ~35 |
WhfmtFormats.Audio |
Audio | ~40 |
WhfmtFormats.CAD |
CAD | ~18 |
WhfmtFormats.Certificates |
Certificates | ~10 |
WhfmtFormats.Crypto |
Crypto | ~8 |
WhfmtFormats.Data |
Data | ~25 |
WhfmtFormats.Database |
Database | ~15 |
WhfmtFormats.Disk |
Disk | ~20 |
WhfmtFormats.Documents |
Documents | ~30 |
WhfmtFormats.Executables |
Executables | ~20 |
WhfmtFormats.Firmware |
Firmware | ~15 |
WhfmtFormats.Fonts |
Fonts | ~12 |
WhfmtFormats.GIS |
GIS | ~15 |
WhfmtFormats.Game |
Game | ~40 |
WhfmtFormats.Images |
Images | ~60 |
WhfmtFormats.IoT |
IoT | ~10 |
WhfmtFormats.MachineLearning |
ML | ~10 |
WhfmtFormats.Medical |
Medical | ~15 |
WhfmtFormats.Network |
Network | ~30 |
WhfmtFormats.Programming |
Programming | ~25 |
WhfmtFormats.RomHacking |
Rom Hacking | ~20 |
WhfmtFormats.Science |
Science | ~15 |
WhfmtFormats.Subtitles |
Subtitles | ~10 |
WhfmtFormats.System |
System | ~30 |
WhfmtFormats.Text |
Text | ~15 |
WhfmtFormats.Video |
Video | ~40 |
WhfmtFormats.Virtualization |
Virtualization | ~15 |
Use only specific formats
Don't need all 856 parsers? Exclude categories or individual files:
<AdditionalFiles Remove="$(NuGetPackageRoot)whfmt.formats\1.0.0\contentFiles\any\any\Formats\Game\**" />
<AdditionalFiles Include="path\to\PNG.whfmt">
<WhfmtNamespace>MyApp.Parsers</WhfmtNamespace>
<WhfmtClass>PngParser</WhfmtClass>
</AdditionalFiles>
Override namespace or class name
<AdditionalFiles Update="$(NuGetPackageRoot)whfmt.formats\1.0.0\contentFiles\any\any\Formats\Images\PNG.whfmt">
<WhfmtNamespace>MyApp.ImageParsers</WhfmtNamespace>
<WhfmtClass>PngReader</WhfmtClass>
</AdditionalFiles>
Relationship to other whfmt packages
| Package | Role |
|---|---|
whfmt.Formats |
This package — ships .whfmt definitions as AdditionalFiles |
whfmt.SourceGenerator |
Roslyn generator — turns AdditionalFiles .whfmt into C# parsers |
whfmt.FileFormatCatalog |
Runtime catalog — format matching, detection, metadata queries |
whfmt.CodeGen |
CLI tool — one-shot generation for F#/Rust/VB or outside MSBuild |
Requirements
- .NET SDK 6.0 or later
whfmt.SourceGenerator— required to actually generate parsers from these definitions
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
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 |
|---|---|---|
| 1.0.0 | 0 | 5/21/2026 |