Skip to content

Commit a2e8368

Browse files
committed
Add netstandard2.0 target for .NET Framework/Core compatibility
- TFMs now: netstandard2.0, net8.0, net9.0, net10.0 - netstandard2.0 enables use from .NET Framework 4.8 and .NET Core 3.1+ (matching the original C++/CLI package's target audience) - IsAotCompatible only set for net8.0+ (not applicable to netstandard2.0) - System.Runtime.CompilerServices.Unsafe package added for netstandard2.0 - Updated README, design doc, and presentation slides - Re-exported PDF All 16 tests pass.
1 parent 52d8380 commit a2e8368

5 files changed

Lines changed: 13 additions & 5 deletions

File tree

ProjectedFSLib.Managed.CSharp/ProjectedFSLib.Managed.CSharp.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>Microsoft.Windows.ProjFS</RootNamespace>
66
<AssemblyName>ProjectedFSLib.Managed</AssemblyName>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<Nullable>enable</Nullable>
99
<LangVersion>latest</LangVersion>
10-
<IsAotCompatible>true</IsAotCompatible>
10+
<IsAotCompatible Condition="'$(TargetFramework)' != 'netstandard2.0'">true</IsAotCompatible>
1111

1212
<!-- Package metadata -->
1313
<PackageId>Microsoft.Windows.ProjFS.CSharp</PackageId>
@@ -22,4 +22,8 @@ Requires Windows 10 version 1809+ with the ProjFS optional feature enabled.</Des
2222
<PackageTags>ProjFS;ProjectedFileSystem;VirtualFileSystem;Windows</PackageTags>
2323
</PropertyGroup>
2424

25+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
26+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
27+
</ItemGroup>
28+
2529
</Project>

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ This is a complete rewrite of the original C++/CLI wrapper. Key improvements:
4646
### ProjectedFSLib.Managed.CSharp project
4747

4848
This project contains the pure C# P/Invoke implementation of the ProjFS managed wrapper,
49-
producing `ProjectedFSLib.Managed.dll`. It targets net8.0 and net10.0.
49+
producing `ProjectedFSLib.Managed.dll`. It targets netstandard2.0, net8.0, and net10.0.
50+
51+
The netstandard2.0 target allows use from .NET Framework 4.8 and .NET Core 3.1+ projects,
52+
providing a migration path from the original C++/CLI package without requiring a TFM upgrade.
5053

5154
### SimpleProviderManaged project
5255

doc/design-pure-csharp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The original ProjFS Managed API is a C++/CLI mixed-mode assembly that wraps the
1818
| NativeAOT | Not supported (mixed-mode incompatible) | Fully supported |
1919
| Trimming | Not supported | `IsAotCompatible=true` |
2020
| Cross-compilation | Requires matching native toolchain | Any machine with .NET SDK |
21-
| TFMs | net48, netcoreapp3.1 | net8.0, net9.0, net10.0+ |
21+
| TFMs | net48, netcoreapp3.1 | netstandard2.0, net8.0, net9.0, net10.0+ |
2222
| Maintenance | Dual C++/C# expertise needed | C# only |
2323

2424
## Design Goals

doc/projfs-pure-csharp-overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The current `ProjectedFSLib.Managed.dll` is a **C++/CLI mixed-mode assembly**.
5252
- `Microsoft.Windows.ProjFS` namespace preserved
5353
- All types, interfaces, delegates, enums — identical signatures
5454
- 16/16 existing tests pass (including symlink tests)
55+
- **netstandard2.0** target for .NET Framework 4.8 / .NET Core 3.1 compatibility
5556

5657
---
5758

@@ -116,7 +117,7 @@ Non-symlink operations work on both NTFS and ReFS.
116117
| Runtime deps | VC++ Redist + Ijwhost.dll | None |
117118
| NativeAOT |||
118119
| Trimming || ✅ (`IsAotCompatible=true`) |
119-
| TFMs | net48, netcoreapp3.1 | net8.0, net9.0, net10.0 |
120+
| TFMs | net48, netcoreapp3.1 | netstandard2.0, net8.0, net9.0, net10.0 |
120121
| Tests passing | 16/16 | 16/16 |
121122
| Lines of code | ~4,000 (C++/CLI) | ~1,700 (C#) |
122123
| Source files | 30+ (.h, .cpp, .vcxproj) | 5 (.cs, .csproj) |
89.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)