Install
dotnet add package Meziantou.Polyfill --version 1.0.29
| Product | Versions |
|---|---|
| .NET Standard |
README
Meziantou.Polyfill
Source Generator that adds polyfill methods and types. This helps working with multi-targeted projects.
You can use the following MSBuild properties to configure which polyfills are generated:
<PropertyGroup>
<!-- semi-column separated list of name prefix -->
<!-- Tip: The name of the generated polyfills are available in the generated "Debug.g.cs" file -->
<MeziantouPolyfill_IncludedPolyfills>T:Type1|T:Type2|M:Member1</MeziantouPolyfill_IncludedPolyfills>
<MeziantouPolyfill_ExcludedPolyfills>M:System.Diagnostics.</MeziantouPolyfill_ExcludedPolyfills>
<!-- Optional: Output the generated files to the obj\GeneratedFiles folder -->
<EmitCompilerGeneratedFiles>True</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
How to add a new polyfill
- Create a new file named
.csin the projectMeziantou.Polyfill.Editor - Run
Meziantou.Polyfill.Generator
Notes:
- All files must be self contained. Use a
file classif needed. - If you need to generate a file only when another polyfill is generated, add
// whenin the file
Changes from Previous Version
No structural changes between v1.0.28 and v1.0.29.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.