Microsoft.Windows.ProjFS 2.0.0

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

ProjFS Managed API

NuGet

Package Microsoft.Windows.ProjFS
Version 2.0.0
Targets netstandard2.0, net8.0, net9.0, net10.0
License MIT

About ProjFS

ProjFS is short for Windows Projected File System. ProjFS allows a user-mode application called a "provider" to project hierarchical data into the file system, making it appear as files and directories in the file system. For example, a simple provider could project the Windows registry into the file system, making registry keys and values appear as files and directories, respectively. An example of a more complex provider is VFS for Git, used to virtualize very large git repos.

Conceptual documentation for ProjFS along with documentation of its Win32 API is at docs.microsoft.com.

Enabling ProjFS

ProjFS enablement is required for this library to work correctly. ProjFS ships as an optional component starting in Windows 10 version 1809.

To enable ProjFS, run the following in an elevated PowerShell prompt:

Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart

About the ProjFS Managed API

The Windows SDK contains a native C API for ProjFS. The ProjFS Managed API provides a pure C# P/Invoke wrapper around the native API so that developers can write ProjFS providers using managed code.

This is a complete rewrite of the original C++/CLI wrapper. Key improvements:

  • No C++ toolchain required — builds with dotnet build, no Visual Studio C++ workload needed
  • NativeAOT compatible — fully supports ahead-of-time compilation and trimming
  • Cross-compilation friendly — can be built on any machine with the .NET SDK
  • LibraryImport on .NET 7+ — uses source-generated P/Invoke marshalling for better AOT perf
  • DllImport fallback — netstandard2.0 target retains traditional P/Invoke for broad compatibility
  • Same API surface — drop-in replacement using the same Microsoft.Windows.ProjFS namespace
  • NuGet ready — publishes to nuget.org as Microsoft.Windows.ProjFS

Prerequisites

  • .NET 10 SDK (required for net10.0 TFM; also builds net8.0/net9.0/netstandard2.0)
  • Windows 10 version 1809 or later with ProjFS enabled

Solution Layout

ProjectedFSLib.Managed project

This project contains the pure C# P/Invoke implementation of the ProjFS managed wrapper, producing ProjectedFSLib.Managed.dll. It targets netstandard2.0, net8.0, and net10.0.

The netstandard2.0 target allows use from .NET Framework 4.8 and .NET Core 3.1+ projects, providing a migration path from the original C++/CLI package without requiring a TFM upgrade.

P/Invoke Strategy

The library uses two P/Invoke strategies depending on the target framework:

Target Strategy Benefit
net8.0, net9.0, net10.0 LibraryImport (source generator) AOT-compatible, no runtime marshalling overhead
netstandard2.0 DllImport (traditional) Broad compatibility (.NET Framework 4.8, .NET Core 3.1+)

The declarations live in two partial class files:

  • ProjFSNative.cs — shared structs/constants + DllImport fallback
  • ProjFSNative.LibraryImport.cs — LibraryImport declarations (compiled only on .NET 7+)

SimpleProviderManaged project

This project builds a simple ProjFS provider, SimpleProviderManaged.exe, that uses the managed API. It projects the contents of one directory (the "source") into another one (the "virtualization root").

ProjectedFSLib.Managed.Test project

This project builds an NUnit test, ProjectedFSLib.Managed.Test.exe, that uses the SimpleProviderManaged provider to exercise the API wrapper.

Building

dotnet build ProjectedFSLib.Managed.slnx -c Release

Or use the build script:

.\scripts\BuildProjFS-Managed.bat Release

Running Tests

dotnet test ProjectedFSLib.Managed.slnx -c Release

Or use the test script:

.\scripts\RunTests.bat Release

NuGet Package

Installing

dotnet add package Microsoft.Windows.ProjFS

Creating a Package Locally

.\scripts\Pack-NuGet.ps1

This produces .nupkg and .snupkg files in artifacts/packages/.

Official NuGet publishing is handled by the internal CI/CD pipeline.

Note: The Windows Projected File System optional component must be enabled before you can run SimpleProviderManaged.exe or a provider of your own devising. Refer to Enabling ProjFS above for instructions.

Known Filesystem Limitations

Symlink placeholders require NTFS. ProjFS symlink support (WritePlaceholderInfo2, PrjFillDirEntryBuffer2 with PRJ_EXT_INFO_TYPE_SYMLINK) uses the NTFS atomic create ECP internally. ReFS does not support this, and PrjWritePlaceholderInfo2 will return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) (0x80070032) when the virtualization root is on a ReFS volume. Non-symlink operations (regular placeholders, file hydration, directory enumeration, notifications) work correctly on both NTFS and ReFS.

If you encounter ERROR_NOT_SUPPORTED from WritePlaceholderInfo2, verify the virtualization root is on an NTFS volume:

Get-Volume -DriveLetter D | Select-Object FileSystem  # Should be "NTFS"

Contributing

For details on how to contribute to this project, see the CONTRIBUTING.md file in this repository.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 (1)

Showing the top 1 popular GitHub repositories that depend on Microsoft.Windows.ProjFS:

Repository Stars
microsoft/VFSForGit
Virtual File System for Git: Enable Git at Enterprise Scale
Version Downloads Last Updated
2.0.0 99 3/6/2026
1.2.21216.1 3,380 8/4/2021 1.2.21216.1 is deprecated.
1.2.21147.3 881 5/27/2021 1.2.21147.3 is deprecated.
1.2.21146.1 739 5/26/2021 1.2.21146.1 is deprecated.
1.2.21139.4 759 5/19/2021 1.2.21139.4 is deprecated.