Plist.Kit
1.0.0
dotnet add package Plist.Kit --version 1.0.0
NuGet\Install-Package Plist.Kit -Version 1.0.0
<PackageReference Include="Plist.Kit" Version="1.0.0" />
<PackageVersion Include="Plist.Kit" Version="1.0.0" />
<PackageReference Include="Plist.Kit" />
paket add Plist.Kit --version 1.0.0
#r "nuget: Plist.Kit, 1.0.0"
#:package Plist.Kit@1.0.0
#addin nuget:?package=Plist.Kit&version=1.0.0
#tool nuget:?package=Plist.Kit&version=1.0.0
Plist.Kit
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 | Versions 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. |
-
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