Sparkdo.VirtualFileSystem 2.0.0-preview.2

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

Sparkdo.VirtualFileSystem

Sparkdo.VirtualFileSystem 是 VFS 的运行时产品包。它组合 Manifest runtime actions 与显式资源 graph,并物化 IVirtualFileProvider

职责

  • 通过随包 analyzer 生成的 bootstrap 自动接收 sparkdo.package-assets.v1sparkdo.generated-resources.v1 graph。
  • PackageAssetGraphBoundaryGeneratedResourceGraphBoundary 校验 graph,并优先读取 graph 内嵌 bytes;sourcePath 只用于兼容旧 graph。
  • VirtualFileViewBuilder 组合 RuntimeActionPlan 中的 resource.sourceresource.mountresource.expose
  • 物化 EmbeddedPhysicalPackageAssetGenerated source。
  • 通过标准 Microsoft.Extensions.Options 消费 VirtualFileSystemOptions,支持配置 physical root、冲突策略与非法 entry 策略。
  • 从同一份只读 entry set 自动注册主读取抽象 IVirtualFileProvider,并在应用未预先注册时提供 IFileProvider bridge;空 view 返回可用的空 provider。

非职责

  • 不编译 Manifest;该职责属于 Polaris compiler/runtime pipeline。
  • 不扫描 package 目录、obj、输出目录或程序集类型。
  • 不从约定路径猜测 graph 或资源。
  • 不把 Microsoft.Extensions.FileProviders.IFileProvider 作为主 VFS 契约。

关键入口

API 用途
SparkdoVirtualFileSystemBootstrap.Apply(...) 连接 generated graph handoff、标准 options、权威 RuntimeActionPlan 与 DI。
PackageAssetGraphBoundary 校验并物化 package asset graph。
GeneratedResourceGraphBoundary 校验并物化 generated resource graph。
VirtualFileViewBuilder 组合 runtime actions 与资源 bytes。
VirtualFileSystemProviderBoundary 校验 view/entry 并创建 IVirtualFileProvider
VirtualFileProviderBoundary 为现有生态提供 IFileProvider compatibility bridge。

依赖

运行时面向 netstandard2.0,依赖 Sparkdo.VirtualFileSystem.AbstractionsSparkdo.ManifestSparkdo.HostingSparkdo.RuntimeMicrosoft.Extensions.DependencyInjectionMicrosoft.Extensions.OptionsMicrosoft.Extensions.FileProviders.AbstractionsSystem.Text.Json。包同时携带并自动启用 Sparkdo.VirtualFileSystem.Compiler analyzer。

集成流程

generated bootstrap contribution
  -> SparkdoVirtualFileSystemBootstrap
  -> package/generated graph boundaries
  -> VirtualFileViewBuilder(authoritative RuntimeActionPlan, options)
  -> shared virtual file entry set
  -> IVirtualFileProvider + IFileProvider

Runtime boundary 遇到 graph、path、identity、hash、mount 或 expose 错误时返回 diagnostics 并 fail closed。

应用可直接使用标准 options 配置:

services.Configure<VirtualFileSystemOptions>(options =>
{
    options.PhysicalRoot = Path.Combine(AppContext.BaseDirectory, "assets");
    options.ConflictBehavior = VirtualFileConflictBehavior.LastWriteWins;
});

验证

dotnet test src/virtual-file-system/Sparkdo.VirtualFileSystem.slnx --no-restore -p:UseSharedCompilation=false -nr:false -m:1
dotnet pack src/virtual-file-system/src/Sparkdo.VirtualFileSystem/Sparkdo.VirtualFileSystem.csproj --no-restore -p:UseSharedCompilation=false -nr:false
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Sparkdo.VirtualFileSystem:

Package Downloads
Sparkdo.Localization

Sparkdo Localization 的 VFS JSON runtime、文化回退与 package manifest。

Sparkdo.Emailing

Sparkdo 邮件发送库,提供基于 SMTP 的邮件发送功能,支持同步/异步发送、后台队列发送和模板邮件

Sparkdo.AspNetCore

Sparkdo ASP.NET Core 集成库,提供与 ASP.NET Core 框架深度集成的功能实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.2 58 7/20/2026
2.0.0-preview.1 49 7/18/2026
1.0.4-preview.3 456 6/8/2026
1.0.4-preview.2 446 6/7/2026
1.0.4-preview.1 411 6/7/2026
1.0.3 1,005 6/6/2026
1.0.3-preview.1 442 5/17/2026
1.0.2 796 4/27/2026
1.0.2-preview.5 173 4/15/2026
1.0.2-preview.4 173 2/8/2026
1.0.2-preview.3 186 2/1/2026
1.0.2-preview.2 198 1/31/2026
1.0.2-preview.1 236 12/4/2025
1.0.1 2,722 11/27/2025
1.0.0 2,690 11/25/2025
1.0.0-preview.5 169 10/24/2025