WinCfApiWrapper 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package WinCfApiWrapper --version 1.2.0
                    
NuGet\Install-Package WinCfApiWrapper -Version 1.2.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="WinCfApiWrapper" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WinCfApiWrapper" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="WinCfApiWrapper" />
                    
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 WinCfApiWrapper --version 1.2.0
                    
#r "nuget: WinCfApiWrapper, 1.2.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 WinCfApiWrapper@1.2.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=WinCfApiWrapper&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=WinCfApiWrapper&version=1.2.0
                    
Install as a Cake Tool

WinCfApiWrapper

CI Codecov coverage OpenSSF Scorecard OpenSSF Best Practices REUSE status SLSA provenance NuGet 0BSD License .NET 8+ Windows x64

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-windows or 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.

Production trusted-build-artifact mode: use TrustedContentId, SkipResumeValidation = true and ZIP validateEntryMetadata: false together only for immutable, app-owned snapshots. These do not skip initial indexing or Windows-required path checks. See TrustedID benchmark and no-regression contract for a reproducible Windows performance harness and merge policy.

For remote ZIPs, use ZipContainer.FromHttp(httpClient, archiveUri) to fetch bounded byte ranges. A stream factory that downloads into a MemoryStream still downloads the archive on every invocation. Set CloudMountOptions.Progress to an IProgress<OperationProgress> for startup, resume, file fetch, explicit hydration, and shutdown updates. See release feedback and performance for verified behavior and trusted-source settings.

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, concurrency limits, progress, and trusted-source options.
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, OperationProgress Observe state, failures, fetch activity, and operation 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

Report ordinary bugs and request features through GitHub issues. Report vulnerabilities privately using the security policy.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows 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.

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.2.1 100 10/29/2026
1.2.0 96 10/22/2026
1.1.0 111 10/19/2026
1.0.0 98 10/18/2026
0.1.16 96 10/18/2026
0.1.8 99 10/17/2026
0.1.0 103 10/17/2026