SOWI.vCard 26.6.30

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

SOWI.vCard

.NET-Bibliothek zum Parsen und Serialisieren von vCard-Dateien (.vcf) — Versionen 2.1, 3.0 und 4.0 (v4.0 gemäss RFC 6350, ältere Formate mit versionsspezifischen Strategien).

Entwickelt von SOWI Informatik.

License: MIT .NET NuGet


Überblick

SOWI.vCard ist eine schlanke Format-Bibliothek ohne externe Abhängigkeiten. Sie wandelt vCard-Text in ein typisiertes Domänenmodell um und zurück — geeignet für Kontaktimport, Adressbuch-Export, CardDAV-Anbindungen und ähnliche Szenarien.

Funktion Beschreibung
Parsen vCard-String, Stream oder Datei → VCard-Objekt
Serialisieren VCard-Objekt → RFC-konformen Text
Mehrfach-vCards Dokumente mit mehreren BEGIN:VCARD-Blöcken (ParseDocument / SerializeDocument)
Versionen 2.1, 3.0, 4.0 mit versionsspezifischen Strategien
Erweiterbar X--Properties → VCard.Extensions; unbekannte Standard-Properties → VCard.Others

Installation

NuGet

dotnet add package SOWI.vCard

Aus dem Quellcode

git clone https://github.com/SOWIinformatik/sowi-vcard.git
cd sowi-vcard
dotnet build SOWI.vCard.slnx
dotnet test SOWI.vCard.slnx

Schnellstart

Empfohlener Einstiegspunkt: VCardService.CreateDefault().

using SOWI.vCard.Abstractions;
using SOWI.vCard.Services;

IVCardService service = VCardService.CreateDefault();

// Parsen (String)
string vCardText = await File.ReadAllTextAsync("kontakt.vcf");
var card = service.Parse(vCardText);

Console.WriteLine(card.FullName);          // z. B. Dr. Erika Mustermann
Console.WriteLine(card.Version);           // z. B. 4.0
Console.WriteLine(card.Emails[0].Address); // z. B. erika@mustermann.de

// Serialisieren
string output = service.Serialize(card);
await File.WriteAllTextAsync("kontakt-export.vcf", output);

Alternativ direkt über die Fassade (async Datei-I/O):

var cardFromFile = await service.ParseFileAsync("kontakt.vcf");
await service.SerializeToFileAsync(cardFromFile, "kontakt-export.vcf");

Mehrere vCards in einer Datei

using SOWI.vCard.Abstractions;
using SOWI.vCard.Domain;
using SOWI.vCard.Services;

IVCardService service = VCardService.CreateDefault();
string document = await File.ReadAllTextAsync("adressbuch.vcf");

IReadOnlyList<VCard> cards = service.ParseDocument(document);
string merged = service.SerializeDocument(cards);

Neues vCard-Objekt erstellen

using SOWI.vCard.Domain;
using SOWI.vCard.Domain.ValueObjects;
using SOWI.vCard.Services;

var card = new VCard
{
    Version = "4.0",
    FullName = "Max Mustermann",
    PersonName = new PersonName { LastName = "Mustermann", FirstName = "Max" },
    Organization = "Beispiel AG",
    Emails = { new Email { Address = "max@example.org" } },
};

string vCardText = VCardService.CreateDefault().Serialize(card);

Dependency Injection

using SOWI.vCard.Abstractions;
using SOWI.vCard.Parsing;
using SOWI.vCard.Serialization;
using SOWI.vCard.Services;

services.AddSingleton<IVCardLineReader, VCardLineReader>();
services.AddSingleton<IVCardParser, VCardParser>();
services.AddSingleton<IVCardSerializer, VCardSerializer>();
services.AddSingleton<IVCardService, VCardService>();

Weitere Beispiele (Photo-Provider, Stream-I/O): src/README.md.


Projektstruktur

sowi-vcard/                         # GitHub-Repository (Projektname: SOWI.vCard)
├── .github/workflows/
│   ├── ci.yml                      # Build, Test, Pack (Artefakte)
│   └── release.yml                 # Manuell: NuGet-Publish
├── src/
│   ├── SOWI.vCard.csproj
│   ├── Domain/                     # VCard-Aggregat, Value Objects, Exceptions
│   ├── Abstractions/               # IVCardParser, IVCardSerializer, IVCardService, …
│   ├── Parsing/                    # Parser, PropertyHandlers, VersionStrategies
│   ├── Serialization/              # VCardSerializer, VCardPropertyWriters
│   ├── Services/                   # VCardService (Fassade), FilePhotoDataProvider
│   └── README.md                   # RFC-Property-Referenz
├── tests/
│   └── SOWI.vCard.Tests/           # Unit- und Integrationstests
├── docs/
│   ├── SOWI.vCard.Architecture.md
│   └── SOWI.vCard.CICD.md
├── Directory.Build.props
├── SOWI.vCard.slnx
├── LICENSE.md
└── .editorconfig

Entwicklung

# Solution bauen
dotnet build SOWI.vCard.slnx

# Tests ausführen
dotnet test SOWI.vCard.slnx

# NuGet-Paket lokal erstellen (Ausgabe: ../Packages/)
dotnet pack src/SOWI.vCard.csproj -c Release

CI-Pipeline (GitHub Actions) und Release-Prozess: docs/SOWI.vCard.CICD.md.


Dokumentation

Dokument Inhalt
src/README.md RFC-Property-Referenz, vCard-Beispiele, API-Details
docs/SOWI.vCard.Architecture.md Ist-Architektur, Design-Prinzipien, Coding Standards
docs/SOWI.vCard.CICD.md CI/CD, Versionierung, Release-Prozess

Lizenz

Dieses Projekt steht unter der MIT-Lizenz.

Copyright © 2026 SOWI Informatik

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
26.6.30 104 6/30/2026
26.6.29 102 6/29/2026