Skip to content

Commit 55ef219

Browse files
committed
Update readme to mention new types and option
1 parent b7d6c57 commit 55ef219

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,26 @@
3535

3636
To leverage them, make sure to bump your C# language version. You can do this by setting the `<LangVersion>` MSBuild property in your project. For instance, by adding `<LangVersion>11.0</LangVersion>` (or your desired C# version) to the first `<PropertyGroup>` of your .csproj file. For more info on this, [see here](https://sergiopedri.medium.com/enabling-and-using-c-9-features-on-older-and-unsupported-runtimes-ce384d8debb), but remember that you don't need to manually copy polyfills anymore: simply adding a reference to **PolySharp** will do this for you automatically.
3737

38+
It also includes the following optional runtime-supported polyfills:
39+
- Reflection annotation attributes (see [docs](https://learn.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming)):
40+
- `[DynamicallyAccessedMembers]`
41+
- `[DynamicDependency]`
42+
- `[RequiresUnreferencedCode]`
43+
- `[UnconditionalSuppressMessage]`
44+
- `[StackTraceHidden]` (see [here](https://makolyte.com/csharp-exclude-exception-throw-helper-methods-from-the-stack-trace/))
45+
- `[UnmanagedCallersOnly]` (see [docs](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedcallersonlyattribute)))
46+
- Platform support annotation attributes (see [docs](https://learn.microsoft.com/dotnet/standard/analyzers/platform-compat-analyzer)):
47+
- `[ObsoletedOSPlatform]`
48+
- `[SupportedOSPlatform]`
49+
- `[SupportedOSPlatformGuard]`
50+
- `[TargetPlatform]`
51+
- `[UnsupportedOSPlatform]`
52+
- `[UnsupportedOSPlatformGuard]`
53+
3854
# Options ⚙️
3955

4056
**PolySharp**'s generation can be configured through some MSBuild properties to set in consuming projects.
4157

4258
The following properties are available:
4359
- "PolySharpUsePublicAccessibilityForGeneratedTypes": changes the accessibility of generated types from `internal` to `public`.
60+
- "PolySharpIncludeRuntimeSupportedAttributes": enables polyfills for (dummy) runtime-supported attributes too.

0 commit comments

Comments
 (0)