WinCfApiWrapper 0.1.16
See the version list below for details.
dotnet add package WinCfApiWrapper --version 0.1.16
NuGet\Install-Package WinCfApiWrapper -Version 0.1.16
<PackageReference Include="WinCfApiWrapper" Version="0.1.16" />
<PackageVersion Include="WinCfApiWrapper" Version="0.1.16" />
<PackageReference Include="WinCfApiWrapper" />
paket add WinCfApiWrapper --version 0.1.16
#r "nuget: WinCfApiWrapper, 0.1.16"
#:package WinCfApiWrapper@0.1.16
#addin nuget:?package=WinCfApiWrapper&version=0.1.16
#tool nuget:?package=WinCfApiWrapper&version=0.1.16
WinCfApiWrapper
Expose a read-only content source as a Windows Cloud Files sync root. Files start as placeholders and their contents are fetched on demand. Built-in containers support ZIP, TAR, TAR.GZ, GZip, Brotli, Deflate, and ZLib; implement IContentContainer for other sources.
Requirements
- Windows x64, Windows 10 version 1709 (build 16299) or later with Cloud Files support.
- .NET 8 or later, targeting
net8.0-windowsor a later Windows target framework.
Installation
dotnet add package WinCfApiWrapper
The example below uses the Microsoft dependency injection container. If your application does not already reference it, also install Microsoft.Extensions.DependencyInjection.
Quick start
using Microsoft.Extensions.DependencyInjection;
using WinCfApiWrapper;
using WinCfApiWrapper.Public;
using WinCfApiWrapper.Public.Containers;
var services = new ServiceCollection();
services.AddWinCfApiWrapper();
using var provider = services.BuildServiceProvider();
var factory = provider.GetRequiredService<ICloudMountFactory>();
await using ICloudMount mount = factory.Open(new CloudMountOptions
{
Container = new ZipContainer(_ => File.OpenRead(@"C:\archives\sample.zip")),
Root = @"C:\Cloud\Sample",
});
mount.Error += (_, error) => Console.Error.WriteLine(error.Exception);
await mount.MountAsync();
Console.WriteLine($"Mounted at {mount.Root}");
await mount.HydrateAsync(@"docs\hello.txt");
MountAsync creates or validates placeholders and connects the sync root; it does not download all files. Windows fetches contents when needed. Use HydrateAsync(path) for one file or HydrateAllAsync(progress) for all files. Bulk hydration reports progress and throws an AggregateException if any files fail. Background fetch failures are reported through Error and the configured logger.
Use a dedicated, disposable mount folder containing no user data. CloudMountOptions.Root is a base path; the actual mount.Root includes a content fingerprint. Disposing the mount disconnects it. To unregister and delete the folder, call ISyncRootManager.Unregister(mount.Root) after disposal. See the lifecycle and cleanup guide before integrating cleanup into an application.
Public API
| Type | Purpose |
|---|---|
ICloudMountFactory / ICloudMount |
Open, mount, inspect, hydrate, and dispose a sync root. |
CloudMountOptions |
Set the container, base path, and fetch/hydration concurrency limits. |
IContentContainer / ContainerEntry |
Provide a stable file and directory listing and streams for file contents. |
ISyncRootManager |
Unregister mounts or clean abandoned mounts under an app-owned folder. |
MountState, MountStatistics, MountErrorEventArgs, HydrationProgress |
Observe mount state, background failures, fetch activity, and bulk hydration progress. |
Public interfaces and built-in containers are in WinCfApiWrapper.Public and WinCfApiWrapper.Public.Containers. AddWinCfApiWrapper() is in WinCfApiWrapper. When the host registers Microsoft.Extensions.Logging, lifecycle and failure events are logged; otherwise the library uses a no-op logger.
Guides and contributing
- Documentation index
- Containers: built-in formats, stream ownership, and custom container contracts.
- Architecture and lifecycle: hydration, errors, resume, and safe cleanup.
- Development: building, testing, fuzzing, and coverage.
- Security model: trust boundaries and limitations.
- Releasing and provenance: release cadence, package verification, and recovery.
- Contributing: submitting issues, tests, and pull requests.
- Security policy: private vulnerability reporting.
Report ordinary bugs and request features through GitHub issues. Report vulnerabilities privately using the security policy.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.