diff --git a/apiCount.include.md b/apiCount.include.md index 61d2cc91..75cf8af9 100644 --- a/apiCount.include.md +++ b/apiCount.include.md @@ -24,5 +24,5 @@ | `net8.0` | 400 | | `net9.0` | 253 | | `net10.0` | 190 | -| `net11.0` | 57 | +| `net11.0` | 56 | | `uap10.0` | 1071 | diff --git a/assemblySize.include.md b/assemblySize.include.md index c65725b2..dac438c8 100644 --- a/assemblySize.include.md +++ b/assemblySize.include.md @@ -2,51 +2,51 @@ | | Empty Assembly | With Polyfill | Diff | Ensure | ArgumentExceptions | StringInterpolation | Nullability | |----------------|----------------|---------------|-----------|-----------|--------------------|---------------------|-------------| -| netstandard2.0 | 8.0KB | 390.5KB | +382.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netstandard2.1 | 8.5KB | 344.5KB | +336.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| net461 | 8.5KB | 389.0KB | +380.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net462 | 7.0KB | 392.5KB | +385.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net47 | 7.0KB | 392.5KB | +385.5KB | +8.5KB | +6.5KB | +9.0KB | +14.0KB | -| net471 | 8.5KB | 391.5KB | +383.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| net472 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net48 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net481 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| netcoreapp2.0 | 9.0KB | 368.0KB | +359.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp2.1 | 9.0KB | 350.5KB | +341.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp2.2 | 9.0KB | 350.5KB | +341.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp3.0 | 9.5KB | 347.0KB | +337.5KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB | -| netcoreapp3.1 | 9.5KB | 345.0KB | +335.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net5.0 | 9.5KB | 310.5KB | +301.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net6.0 | 10.0KB | 252.0KB | +242.0KB | +9.5KB | +6.5KB | +512bytes | +3.0KB | -| net7.0 | 10.0KB | 221.5KB | +211.5KB | +9.5KB | +6.0KB | +512bytes | +3.5KB | -| net8.0 | 9.5KB | 191.5KB | +182.0KB | +8.5KB | | +512bytes | +3.0KB | -| net9.0 | 9.5KB | 120.0KB | +110.5KB | +8.5KB | | +512bytes | +3.5KB | -| net10.0 | 10.0KB | 95.5KB | +85.5KB | +8.5KB | | +512bytes | +3.5KB | -| net11.0 | 10.0KB | 21.0KB | +11.0KB | +9.0KB | | +512bytes | +3.5KB | +| netstandard2.0 | 8.0KB | 406.5KB | +398.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| netstandard2.1 | 8.5KB | 351.5KB | +343.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | +| net461 | 8.5KB | 405.0KB | +396.5KB | +9.0KB | +7.0KB | +9.5KB | +14.5KB | +| net462 | 7.0KB | 408.5KB | +401.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| net47 | 7.0KB | 408.5KB | +401.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| net471 | 8.5KB | 407.5KB | +399.0KB | +9.5KB | +7.0KB | +9.5KB | +14.5KB | +| net472 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| net48 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| net481 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp2.0 | 9.0KB | 384.0KB | +375.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp2.1 | 9.0KB | 361.5KB | +352.5KB | +7.5KB | +5.5KB | +8.0KB | +13.0KB | +| netcoreapp2.2 | 9.0KB | 361.5KB | +352.5KB | +7.5KB | +5.5KB | +8.0KB | +13.0KB | +| netcoreapp3.0 | 9.5KB | 350.0KB | +340.5KB | +8.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp3.1 | 9.5KB | 350.0KB | +340.5KB | +8.0KB | +6.5KB | +9.5KB | +14.0KB | +| net5.0 | 9.5KB | 315.5KB | +306.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB | +| net6.0 | 10.0KB | 255.0KB | +245.0KB | +9.5KB | +6.5KB | +512bytes | +3.0KB | +| net7.0 | 10.0KB | 224.5KB | +214.5KB | +9.5KB | +6.0KB | +512bytes | +3.5KB | +| net8.0 | 9.5KB | 196.0KB | +186.5KB | +8.0KB | | +512bytes | +3.0KB | +| net9.0 | 9.5KB | 126.0KB | +116.5KB | +8.5KB | | +512bytes | +3.5KB | +| net10.0 | 10.0KB | 101.5KB | +91.5KB | +8.5KB | | +512bytes | +3.5KB | +| net11.0 | 10.0KB | 17.5KB | +7.5KB | +9.0KB | | +512bytes | +3.5KB | ### Assembly Sizes with EmbedUntrackedSources | | Empty Assembly | With Polyfill | Diff | Ensure | ArgumentExceptions | StringInterpolation | Nullability | |----------------|----------------|---------------|-----------|-----------|--------------------|---------------------|-------------| -| netstandard2.0 | 8.0KB | 568.9KB | +560.9KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netstandard2.1 | 8.5KB | 494.7KB | +486.2KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| net461 | 8.5KB | 568.4KB | +559.9KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net462 | 7.0KB | 571.9KB | +564.9KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net47 | 7.0KB | 571.7KB | +564.7KB | +16.2KB | +8.2KB | +13.9KB | +19.4KB | -| net471 | 8.5KB | 570.3KB | +561.8KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| net472 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net48 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net481 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| netcoreapp2.0 | 9.0KB | 535.8KB | +526.8KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp2.1 | 9.0KB | 506.1KB | +497.1KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp2.2 | 9.0KB | 506.1KB | +497.1KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp3.0 | 9.5KB | 494.7KB | +485.2KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB | -| netcoreapp3.1 | 9.5KB | 492.7KB | +483.2KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net5.0 | 9.5KB | 440.8KB | +431.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net6.0 | 10.0KB | 362.1KB | +352.1KB | +17.2KB | +8.2KB | +1.1KB | +3.7KB | -| net7.0 | 10.0KB | 315.5KB | +305.5KB | +17.1KB | +7.4KB | +1.1KB | +4.2KB | -| net8.0 | 9.5KB | 271.1KB | +261.6KB | +16.0KB | +299bytes | +1.1KB | +3.7KB | -| net9.0 | 9.5KB | 173.6KB | +164.1KB | +16.0KB | | +1.1KB | +4.2KB | -| net10.0 | 10.0KB | 139.1KB | +129.1KB | +16.0KB | | +1.1KB | +4.2KB | -| net11.0 | 10.0KB | 30.9KB | +20.9KB | +16.5KB | | +1.1KB | +4.2KB | +| netstandard2.0 | 8.0KB | 593.8KB | +585.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| netstandard2.1 | 8.5KB | 506.7KB | +498.2KB | +16.6KB | +8.2KB | +13.9KB | +19.4KB | +| net461 | 8.5KB | 593.3KB | +584.8KB | +16.6KB | +8.7KB | +14.4KB | +19.9KB | +| net462 | 7.0KB | 596.8KB | +589.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| net47 | 7.0KB | 596.8KB | +589.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| net471 | 8.5KB | 595.2KB | +586.7KB | +17.1KB | +8.7KB | +14.4KB | +19.9KB | +| net472 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| net48 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| net481 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp2.0 | 9.0KB | 560.7KB | +551.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp2.1 | 9.0KB | 523.9KB | +514.9KB | +15.1KB | +7.2KB | +12.9KB | +18.4KB | +| netcoreapp2.2 | 9.0KB | 523.9KB | +514.9KB | +15.1KB | +7.2KB | +12.9KB | +18.4KB | +| netcoreapp3.0 | 9.5KB | 502.0KB | +492.5KB | +15.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp3.1 | 9.5KB | 502.0KB | +492.5KB | +15.6KB | +8.2KB | +14.4KB | +19.4KB | +| net5.0 | 9.5KB | 449.4KB | +439.9KB | +16.6KB | +8.2KB | +13.9KB | +18.9KB | +| net6.0 | 10.0KB | 367.6KB | +357.6KB | +17.1KB | +8.2KB | +1.1KB | +3.7KB | +| net7.0 | 10.0KB | 320.3KB | +310.3KB | +17.0KB | +7.4KB | +1.1KB | +4.2KB | +| net8.0 | 9.5KB | 277.2KB | +267.7KB | +15.4KB | +299bytes | +1.1KB | +3.7KB | +| net9.0 | 9.5KB | 180.8KB | +171.3KB | +15.9KB | | +1.1KB | +4.2KB | +| net10.0 | 10.0KB | 146.2KB | +136.2KB | +15.9KB | | +1.1KB | +4.2KB | +| net11.0 | 10.0KB | 25.7KB | +15.7KB | +16.4KB | | +1.1KB | +4.2KB | diff --git a/readme.md b/readme.md index 8a166175..2c76398c 100644 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ The package targets `netstandard2.0` and is designed to support the following ru | `net8.0` | 400 | | `net9.0` | 253 | | `net10.0` | 190 | -| `net11.0` | 57 | +| `net11.0` | 56 | | `uap10.0` | 1071 | @@ -101,54 +101,54 @@ Only [SDK-style projects](https://learn.microsoft.com/en-us/dotnet/core/project- | | Empty Assembly | With Polyfill | Diff | Ensure | ArgumentExceptions | StringInterpolation | Nullability | |----------------|----------------|---------------|-----------|-----------|--------------------|---------------------|-------------| -| netstandard2.0 | 8.0KB | 390.5KB | +382.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netstandard2.1 | 8.5KB | 344.5KB | +336.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| net461 | 8.5KB | 389.0KB | +380.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net462 | 7.0KB | 392.5KB | +385.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net47 | 7.0KB | 392.5KB | +385.5KB | +8.5KB | +6.5KB | +9.0KB | +14.0KB | -| net471 | 8.5KB | 391.5KB | +383.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| net472 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net48 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net481 | 8.5KB | 390.0KB | +381.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| netcoreapp2.0 | 9.0KB | 368.0KB | +359.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp2.1 | 9.0KB | 350.5KB | +341.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp2.2 | 9.0KB | 350.5KB | +341.5KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | -| netcoreapp3.0 | 9.5KB | 347.0KB | +337.5KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB | -| netcoreapp3.1 | 9.5KB | 345.0KB | +335.5KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net5.0 | 9.5KB | 310.5KB | +301.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net6.0 | 10.0KB | 252.0KB | +242.0KB | +9.5KB | +6.5KB | +512bytes | +3.0KB | -| net7.0 | 10.0KB | 221.5KB | +211.5KB | +9.5KB | +6.0KB | +512bytes | +3.5KB | -| net8.0 | 9.5KB | 191.5KB | +182.0KB | +8.5KB | | +512bytes | +3.0KB | -| net9.0 | 9.5KB | 120.0KB | +110.5KB | +8.5KB | | +512bytes | +3.5KB | -| net10.0 | 10.0KB | 95.5KB | +85.5KB | +8.5KB | | +512bytes | +3.5KB | -| net11.0 | 10.0KB | 21.0KB | +11.0KB | +9.0KB | | +512bytes | +3.5KB | +| netstandard2.0 | 8.0KB | 406.5KB | +398.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| netstandard2.1 | 8.5KB | 351.5KB | +343.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | +| net461 | 8.5KB | 405.0KB | +396.5KB | +9.0KB | +7.0KB | +9.5KB | +14.5KB | +| net462 | 7.0KB | 408.5KB | +401.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| net47 | 7.0KB | 408.5KB | +401.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| net471 | 8.5KB | 407.5KB | +399.0KB | +9.5KB | +7.0KB | +9.5KB | +14.5KB | +| net472 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| net48 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| net481 | 8.5KB | 406.5KB | +398.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp2.0 | 9.0KB | 384.0KB | +375.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp2.1 | 9.0KB | 361.5KB | +352.5KB | +7.5KB | +5.5KB | +8.0KB | +13.0KB | +| netcoreapp2.2 | 9.0KB | 361.5KB | +352.5KB | +7.5KB | +5.5KB | +8.0KB | +13.0KB | +| netcoreapp3.0 | 9.5KB | 350.0KB | +340.5KB | +8.0KB | +6.5KB | +9.5KB | +14.0KB | +| netcoreapp3.1 | 9.5KB | 350.0KB | +340.5KB | +8.0KB | +6.5KB | +9.5KB | +14.0KB | +| net5.0 | 9.5KB | 315.5KB | +306.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB | +| net6.0 | 10.0KB | 255.0KB | +245.0KB | +9.5KB | +6.5KB | +512bytes | +3.0KB | +| net7.0 | 10.0KB | 224.5KB | +214.5KB | +9.5KB | +6.0KB | +512bytes | +3.5KB | +| net8.0 | 9.5KB | 196.0KB | +186.5KB | +8.0KB | | +512bytes | +3.0KB | +| net9.0 | 9.5KB | 126.0KB | +116.5KB | +8.5KB | | +512bytes | +3.5KB | +| net10.0 | 10.0KB | 101.5KB | +91.5KB | +8.5KB | | +512bytes | +3.5KB | +| net11.0 | 10.0KB | 17.5KB | +7.5KB | +9.0KB | | +512bytes | +3.5KB | ### Assembly Sizes with EmbedUntrackedSources | | Empty Assembly | With Polyfill | Diff | Ensure | ArgumentExceptions | StringInterpolation | Nullability | |----------------|----------------|---------------|-----------|-----------|--------------------|---------------------|-------------| -| netstandard2.0 | 8.0KB | 568.9KB | +560.9KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netstandard2.1 | 8.5KB | 494.7KB | +486.2KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| net461 | 8.5KB | 568.4KB | +559.9KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net462 | 7.0KB | 571.9KB | +564.9KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net47 | 7.0KB | 571.7KB | +564.7KB | +16.2KB | +8.2KB | +13.9KB | +19.4KB | -| net471 | 8.5KB | 570.3KB | +561.8KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| net472 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net48 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net481 | 8.5KB | 567.8KB | +559.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| netcoreapp2.0 | 9.0KB | 535.8KB | +526.8KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp2.1 | 9.0KB | 506.1KB | +497.1KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp2.2 | 9.0KB | 506.1KB | +497.1KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp3.0 | 9.5KB | 494.7KB | +485.2KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB | -| netcoreapp3.1 | 9.5KB | 492.7KB | +483.2KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net5.0 | 9.5KB | 440.8KB | +431.3KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net6.0 | 10.0KB | 362.1KB | +352.1KB | +17.2KB | +8.2KB | +1.1KB | +3.7KB | -| net7.0 | 10.0KB | 315.5KB | +305.5KB | +17.1KB | +7.4KB | +1.1KB | +4.2KB | -| net8.0 | 9.5KB | 271.1KB | +261.6KB | +16.0KB | +299bytes | +1.1KB | +3.7KB | -| net9.0 | 9.5KB | 173.6KB | +164.1KB | +16.0KB | | +1.1KB | +4.2KB | -| net10.0 | 10.0KB | 139.1KB | +129.1KB | +16.0KB | | +1.1KB | +4.2KB | -| net11.0 | 10.0KB | 30.9KB | +20.9KB | +16.5KB | | +1.1KB | +4.2KB | +| netstandard2.0 | 8.0KB | 593.8KB | +585.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| netstandard2.1 | 8.5KB | 506.7KB | +498.2KB | +16.6KB | +8.2KB | +13.9KB | +19.4KB | +| net461 | 8.5KB | 593.3KB | +584.8KB | +16.6KB | +8.7KB | +14.4KB | +19.9KB | +| net462 | 7.0KB | 596.8KB | +589.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| net47 | 7.0KB | 596.8KB | +589.8KB | +16.6KB | +8.2KB | +14.4KB | +19.9KB | +| net471 | 8.5KB | 595.2KB | +586.7KB | +17.1KB | +8.7KB | +14.4KB | +19.9KB | +| net472 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| net48 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| net481 | 8.5KB | 593.2KB | +584.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp2.0 | 9.0KB | 560.7KB | +551.7KB | +16.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp2.1 | 9.0KB | 523.9KB | +514.9KB | +15.1KB | +7.2KB | +12.9KB | +18.4KB | +| netcoreapp2.2 | 9.0KB | 523.9KB | +514.9KB | +15.1KB | +7.2KB | +12.9KB | +18.4KB | +| netcoreapp3.0 | 9.5KB | 502.0KB | +492.5KB | +15.6KB | +8.2KB | +14.4KB | +19.4KB | +| netcoreapp3.1 | 9.5KB | 502.0KB | +492.5KB | +15.6KB | +8.2KB | +14.4KB | +19.4KB | +| net5.0 | 9.5KB | 449.4KB | +439.9KB | +16.6KB | +8.2KB | +13.9KB | +18.9KB | +| net6.0 | 10.0KB | 367.6KB | +357.6KB | +17.1KB | +8.2KB | +1.1KB | +3.7KB | +| net7.0 | 10.0KB | 320.3KB | +310.3KB | +17.0KB | +7.4KB | +1.1KB | +4.2KB | +| net8.0 | 9.5KB | 277.2KB | +267.7KB | +15.4KB | +299bytes | +1.1KB | +3.7KB | +| net9.0 | 9.5KB | 180.8KB | +171.3KB | +15.9KB | | +1.1KB | +4.2KB | +| net10.0 | 10.0KB | 146.2KB | +136.2KB | +15.9KB | | +1.1KB | +4.2KB | +| net11.0 | 10.0KB | 25.7KB | +15.7KB | +16.4KB | | +1.1KB | +4.2KB | diff --git a/src/Consume/Consume.cs b/src/Consume/Consume.cs index 6ed9ebbe..00911a95 100644 --- a/src/Consume/Consume.cs +++ b/src/Consume/Consume.cs @@ -1274,9 +1274,7 @@ void File_Methods() // Use the | bitwise OR operator to combine multiple file modes File.SetUnixFileMode(TestFilePath, UnixFileMode.OtherRead | UnixFileMode.OtherWrite); -#if !NET11_0_OR_GREATER using var nullHandle = File.OpenNullHandle(); -#endif var hardLink = File.CreateHardLink("hardlink.txt", TestFilePath); var fileInfo = new FileInfo("hardlink2.txt"); diff --git a/src/Polyfill/FilePolyfill.cs b/src/Polyfill/FilePolyfill.cs index 9f7d05db..b0073bdd 100644 --- a/src/Polyfill/FilePolyfill.cs +++ b/src/Polyfill/FilePolyfill.cs @@ -532,7 +532,7 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) } #endif -#if !NET12_0_OR_GREATER +#if !NET11_0_OR_GREATER extension(File) { /// diff --git a/src/Split/net10.0/FilePolyfill.cs b/src/Split/net10.0/FilePolyfill.cs index 229a52cc..9d18045b 100644 --- a/src/Split/net10.0/FilePolyfill.cs +++ b/src/Split/net10.0/FilePolyfill.cs @@ -31,7 +31,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -91,5 +90,4 @@ internal static void CreateHardLink(string path, string pathToTarget) [DllImport("libc", SetLastError = true)] static extern int link(string oldpath, string newpath); } -#endif } diff --git a/src/Split/net11.0/FilePolyfill.cs b/src/Split/net11.0/FilePolyfill.cs deleted file mode 100644 index 1b6a7824..00000000 --- a/src/Split/net11.0/FilePolyfill.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -#pragma warning disable -namespace Polyfills; -using System; -using System.IO; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Text; -using System.Threading.Tasks; -using System.Threading; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; -static partial class Polyfill -{ -#if !NET12_0_OR_GREATER - extension(File) - { - /// - /// Opens a handle to the operating system's null device. - /// - public static SafeFileHandle OpenNullHandle() - { - var path = OperatingSystem.IsWindows() ? "NUL" : "/dev/null"; - return File.OpenHandle(path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); - } - } - [ExcludeFromCodeCoverage] - [DebuggerNonUserCode] -#if PolyUseEmbeddedAttribute - [global::Microsoft.CodeAnalysis.EmbeddedAttribute] -#endif - static class HardLinkHelper - { - internal static void ValidatePath(string path, string paramName) - { - if (path is null) - { - throw new ArgumentNullException(paramName); - } - if (path.Length == 0) - { - throw new ArgumentException("Empty file name is not legal.", paramName); - } - } - internal static void CreateHardLink(string path, string pathToTarget) - { -#if FeatureRuntimeInformation - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) -#else - if (Environment.OSVersion.Platform == PlatformID.Win32NT) -#endif - { - if (!CreateHardLinkW(path, pathToTarget, IntPtr.Zero)) - { - throw new IOException( - $"Unable to create hard link '{path}' to '{pathToTarget}'.", - Marshal.GetHRForLastWin32Error()); - } - } - else - { - if (link(pathToTarget, path) != 0) - { - throw new IOException( - $"Unable to create hard link '{path}' to '{pathToTarget}'.", - Marshal.GetHRForLastWin32Error()); - } - } - } - [DllImport("kernel32.dll", EntryPoint = "CreateHardLinkW", CharSet = CharSet.Unicode, SetLastError = true)] - static extern bool CreateHardLinkW(string lpFileName, string lpExistingFileName, IntPtr lpSecurityAttributes); - [DllImport("libc", SetLastError = true)] - static extern int link(string oldpath, string newpath); - } -#endif -} diff --git a/src/Split/net461/FilePolyfill.cs b/src/Split/net461/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net461/FilePolyfill.cs +++ b/src/Split/net461/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net462/FilePolyfill.cs b/src/Split/net462/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net462/FilePolyfill.cs +++ b/src/Split/net462/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net47/FilePolyfill.cs b/src/Split/net47/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net47/FilePolyfill.cs +++ b/src/Split/net47/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net471/FilePolyfill.cs b/src/Split/net471/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net471/FilePolyfill.cs +++ b/src/Split/net471/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net472/FilePolyfill.cs b/src/Split/net472/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net472/FilePolyfill.cs +++ b/src/Split/net472/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net48/FilePolyfill.cs b/src/Split/net48/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net48/FilePolyfill.cs +++ b/src/Split/net48/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net481/FilePolyfill.cs b/src/Split/net481/FilePolyfill.cs index c9142561..37c0f10a 100644 --- a/src/Split/net481/FilePolyfill.cs +++ b/src/Split/net481/FilePolyfill.cs @@ -408,7 +408,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -516,5 +515,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net5.0/FilePolyfill.cs b/src/Split/net5.0/FilePolyfill.cs index b915ab0e..50b10fbc 100644 --- a/src/Split/net5.0/FilePolyfill.cs +++ b/src/Split/net5.0/FilePolyfill.cs @@ -148,7 +148,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -256,5 +255,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/net6.0/FilePolyfill.cs b/src/Split/net6.0/FilePolyfill.cs index b65d0ebb..9a46a0ae 100644 --- a/src/Split/net6.0/FilePolyfill.cs +++ b/src/Split/net6.0/FilePolyfill.cs @@ -148,7 +148,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -208,5 +207,4 @@ internal static void CreateHardLink(string path, string pathToTarget) [DllImport("libc", SetLastError = true)] static extern int link(string oldpath, string newpath); } -#endif } diff --git a/src/Split/net7.0/FilePolyfill.cs b/src/Split/net7.0/FilePolyfill.cs index b8424e60..455d3b47 100644 --- a/src/Split/net7.0/FilePolyfill.cs +++ b/src/Split/net7.0/FilePolyfill.cs @@ -124,7 +124,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -184,5 +183,4 @@ internal static void CreateHardLink(string path, string pathToTarget) [DllImport("libc", SetLastError = true)] static extern int link(string oldpath, string newpath); } -#endif } diff --git a/src/Split/net8.0/FilePolyfill.cs b/src/Split/net8.0/FilePolyfill.cs index b8424e60..455d3b47 100644 --- a/src/Split/net8.0/FilePolyfill.cs +++ b/src/Split/net8.0/FilePolyfill.cs @@ -124,7 +124,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -184,5 +183,4 @@ internal static void CreateHardLink(string path, string pathToTarget) [DllImport("libc", SetLastError = true)] static extern int link(string oldpath, string newpath); } -#endif } diff --git a/src/Split/net9.0/FilePolyfill.cs b/src/Split/net9.0/FilePolyfill.cs index 229a52cc..9d18045b 100644 --- a/src/Split/net9.0/FilePolyfill.cs +++ b/src/Split/net9.0/FilePolyfill.cs @@ -31,7 +31,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -91,5 +90,4 @@ internal static void CreateHardLink(string path, string pathToTarget) [DllImport("libc", SetLastError = true)] static extern int link(string oldpath, string newpath); } -#endif } diff --git a/src/Split/netcoreapp2.0/FilePolyfill.cs b/src/Split/netcoreapp2.0/FilePolyfill.cs index 1a997720..73e5c3f2 100644 --- a/src/Split/netcoreapp2.0/FilePolyfill.cs +++ b/src/Split/netcoreapp2.0/FilePolyfill.cs @@ -262,7 +262,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -370,5 +369,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netcoreapp2.1/FilePolyfill.cs b/src/Split/netcoreapp2.1/FilePolyfill.cs index 1a997720..73e5c3f2 100644 --- a/src/Split/netcoreapp2.1/FilePolyfill.cs +++ b/src/Split/netcoreapp2.1/FilePolyfill.cs @@ -262,7 +262,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -370,5 +369,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netcoreapp2.2/FilePolyfill.cs b/src/Split/netcoreapp2.2/FilePolyfill.cs index 1a997720..73e5c3f2 100644 --- a/src/Split/netcoreapp2.2/FilePolyfill.cs +++ b/src/Split/netcoreapp2.2/FilePolyfill.cs @@ -262,7 +262,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -370,5 +369,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netcoreapp3.0/FilePolyfill.cs b/src/Split/netcoreapp3.0/FilePolyfill.cs index b915ab0e..50b10fbc 100644 --- a/src/Split/netcoreapp3.0/FilePolyfill.cs +++ b/src/Split/netcoreapp3.0/FilePolyfill.cs @@ -148,7 +148,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -256,5 +255,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netcoreapp3.1/FilePolyfill.cs b/src/Split/netcoreapp3.1/FilePolyfill.cs index b915ab0e..50b10fbc 100644 --- a/src/Split/netcoreapp3.1/FilePolyfill.cs +++ b/src/Split/netcoreapp3.1/FilePolyfill.cs @@ -148,7 +148,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -256,5 +255,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netstandard2.0/FilePolyfill.cs b/src/Split/netstandard2.0/FilePolyfill.cs index 80ac6620..a5f875a3 100644 --- a/src/Split/netstandard2.0/FilePolyfill.cs +++ b/src/Split/netstandard2.0/FilePolyfill.cs @@ -412,7 +412,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -520,5 +519,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/netstandard2.1/FilePolyfill.cs b/src/Split/netstandard2.1/FilePolyfill.cs index 1a997720..73e5c3f2 100644 --- a/src/Split/netstandard2.1/FilePolyfill.cs +++ b/src/Split/netstandard2.1/FilePolyfill.cs @@ -262,7 +262,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -370,5 +369,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Split/uap10.0/FilePolyfill.cs b/src/Split/uap10.0/FilePolyfill.cs index 80ac6620..a5f875a3 100644 --- a/src/Split/uap10.0/FilePolyfill.cs +++ b/src/Split/uap10.0/FilePolyfill.cs @@ -412,7 +412,6 @@ public static FileSystemInfo CreateHardLink(string path, string pathToTarget) return new FileInfo(path); } } -#if !NET12_0_OR_GREATER extension(File) { /// @@ -520,5 +519,4 @@ static extern SafeFileHandle CreateFileW( uint dwFlagsAndAttributes, IntPtr hTemplateFile); } -#endif } diff --git a/src/Tests/FilePolyfillTests.cs b/src/Tests/FilePolyfillTests.cs index 1e5cbf9b..ecc74b7b 100644 --- a/src/Tests/FilePolyfillTests.cs +++ b/src/Tests/FilePolyfillTests.cs @@ -672,6 +672,18 @@ public async Task OpenNullHandle() await Assert.That(handle.IsClosed).IsFalse(); } + // Where the BCL declares File.OpenNullHandle the polyfill must not be compiled: a static + // member of the type always wins over a static extension member, so it would be dead code. + [Test] + public async Task OpenNullHandle_NotPolyfilledWhereBclHasIt() + { + var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; + var inBcl = typeof(File).GetMethod("OpenNullHandle", flags, null, Type.EmptyTypes, null) != null; + var inPolyfill = typeof(Polyfills.Polyfill).GetMethod("OpenNullHandle", flags, null, Type.EmptyTypes, null) != null; + + await Assert.That(inBcl && inPolyfill).IsFalse(); + } + [Test] public async Task CreateHardLink_CreatesLinkToExistingFile() {