Sparkdo.VirtualFileSystem.Compiler 2.0.0-preview.2

This is a prerelease version of Sparkdo.VirtualFileSystem.Compiler.
dotnet add package Sparkdo.VirtualFileSystem.Compiler --version 2.0.0-preview.2
                    
NuGet\Install-Package Sparkdo.VirtualFileSystem.Compiler -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.Compiler" 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.Compiler" Version="2.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.VirtualFileSystem.Compiler" />
                    
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.Compiler --version 2.0.0-preview.2
                    
#r "nuget: Sparkdo.VirtualFileSystem.Compiler, 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.Compiler@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.Compiler&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.VirtualFileSystem.Compiler&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Tool

Sparkdo.VirtualFileSystem.Compiler

Sparkdo.VirtualFileSystem.Compiler 是 VFS 的 Roslyn source generator 包。

职责

  • 读取 build_property.SparkdoManifestRole
  • 读取标记为 SparkdoPackageAssetGraphSparkdoGeneratedResourceGraph 的 AdditionalFiles。
  • Application role 下生成 VFS bootstrap contribution。
  • 将两份显式 graph JSON 嵌入对 SparkdoVirtualFileSystemBootstrap.Apply(...) 的调用;当前 build graph 内嵌已校验资源 bytes,因此部署运行不依赖构建机绝对路径。
  • Package role 下不生成 bootstrap contribution。

非职责

  • 不验证 graph schema、文件路径或 content hash。
  • 不读取 package、obj 或输出目录。
  • 不物化 RuntimeActionPlan、virtual file view 或 provider。
  • 不通过反射或程序集扫描发现资源。

关键入口

API / artifact 用途
SparkdoVirtualFileSystemGenerator incremental generator 入口。
VirtualFileSystemBootstrapContributionEmitter 生成 bootstrap source。
SparkdoVirtualFileSystemBootstrapContribution.g.cs Application role 生成物。
build_metadata.AdditionalFiles.SparkdoPackageAssetGraph package asset graph 标记。
build_metadata.AdditionalFiles.SparkdoGeneratedResourceGraph generated resource graph 标记。

依赖

项目面向 netstandard2.0,仅编译期私有依赖 Microsoft.CodeAnalysis.CSharp。NuGet 包只把编译器 DLL 放入 analyzers/dotnet/cs

集成

Sparkdo.VirtualFileSystem 运行时包携带本 analyzer。Compiler 测试使用 SourceGenerationSpec 提供 role、AdditionalFiles metadata 和 product assembly reference,并验证 Application/Package role 分界、generated compilation 与 deterministic output。

验证

dotnet test src/virtual-file-system/test/Sparkdo.VirtualFileSystem.Compiler.Tests/Sparkdo.VirtualFileSystem.Compiler.Tests.csproj --no-restore -p:UseSharedCompilation=false -nr:false
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.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
2.0.0-preview.2 77 7/20/2026
2.0.0-preview.1 63 7/18/2026