Plist.Kit 1.0.0

dotnet add package Plist.Kit --version 1.0.0
                    
NuGet\Install-Package Plist.Kit -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="Plist.Kit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plist.Kit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Plist.Kit" />
                    
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 Plist.Kit --version 1.0.0
                    
#r "nuget: Plist.Kit, 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 Plist.Kit@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=Plist.Kit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Plist.Kit&version=1.0.0
                    
Install as a Cake Tool

Plist.Kit

NuGet Version NuGet Downloads License: MIT

A simple .NET library for working with macOS plist files. Supports XML, binary, and ASCII formats.

Why another plist library?

Most existing plist libraries are either too complex, have heavy dependencies, or don't support all three plist formats. I needed something lightweight that "just works" for my macOS development projects, so I built this.

What it does

  • Reads and writes plist files in XML, binary (v0), and ASCII formats
  • Automatically detects file format (no need to specify)
  • Supports all standard plist types (strings, numbers, dates, data, arrays, dictionaries)
  • Simple dot-notation for nested keys: doc.GetString("CFBundleIdentifier")
  • No external dependencies

Installation

Install via NuGet:

dotnet add package Plist.Kit

Usage

using PlistKit;
using PlistKit.Core.Types;

// Parse any plist file
var doc = PlistDocument.Load("Info.plist");

// Read values
string bundleId = doc.GetString("CFBundleIdentifier") ?? "";
string appName = doc.GetString("CFBundleName") ?? "Unknown";

// Modify
doc.Set("CFBundleVersion", new PlistString("1.2.3"));
doc.Set("MyCustom.Setting", new PlistInteger(42));

// Save as different format
doc.Save(File.Create("output.xml"), PlistFormat.Xml);
doc.Save(File.Create("output.binary"), PlistFormat.Binary);

// Or get as Dictionary for JSON serialization etc
var dict = doc.ToDictionary();

More Examples

Reading app info:

var doc = PlistDocument.Load("Info.plist");
string appName = doc.GetString("CFBundleDisplayName") ?? "Unknown App";
string version = doc.GetString("CFBundleShortVersionString") ?? "1.0";
Console.WriteLine($"{appName} v{version}");

Working with arrays:

var doc = PlistDocument.Load("SomeConfig.plist");
if (doc.Get("SupportedLanguages") is PlistArray langs)
{
    langs.Add(new PlistString("zh-CN"));
    doc.Save(File.Create("UpdatedConfig.plist"), PlistFormat.Xml);
}

Error handling:

try 
{
    var doc = PlistDocument.Load("MightNotExist.plist");
} 
catch (PlistException ex)
{
    Console.WriteLine($"Failed to parse plist: {ex.Message}");
}

Supported Formats

  • XML: Standard Apple/Xcode format
  • Binary: Compact v0 format
  • ASCII: OpenStep/GNUstep text format

Implementation Notes

The library handles date conversion automatically (Apple uses 2001-01-01 as epoch). Binary format supports object deduplication. ASCII format includes basic comment parsing.

All parsers are designed to be permissive - they'll try to parse malformed files when possible.

Contributing

PRs welcome! Please keep changes focused and add tests for new features.

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • 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 131 9/4/2025

See CHANGELOG.md for release notes