PolySharp icon indicating copy to clipboard operation
PolySharp copied to clipboard

PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀

Results 23 PolySharp issues
Sort by recently updated
recently updated
newest added

I have a .Net library project that dual-targets `netstandard2.0` and `net8.0`. On one of my classes I'd like to have an indexer that takes a `Range` object, which, for the...

### Description If one project references two other projects that both have InternalsVisibleTo to the first project defined, the first project can't use C# features that should be enabled by...

### Description The `ConstantExpectedAttribute` attribute was added in net7.0 [MS Docs](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.constantexpectedattribute?view=net-8.0) ### Rationale Along with [CA1856: Incorrect usage of ConstantExpected attribute](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1856), this will help enforce parameters that are expected to...

### Description (optional) I have several NetFramework 4.6.2 projects in a solution and when compiling them, I noticed build issues when using the new range syntax for strings. I replaced...

A multi target project net6, net472 with c# 12 is developed to support both windows and Linux. ```12 ``` i use global.json that allow sdk6: ``` { "sdk": { "version":...

### Reproduction Steps Make a project that targets `netstandard2.1` and `net8.0` ```xml netstandard2.1;net8.0 ``` and add a `record class` to it with some members, or alternatively a class with `required...

### Reproduction Steps Can not compile the next code for [.NET Standard 1.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0) without [InAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.inattribute). ```cs public static class Foo { public static ref readonly object GetPinnableReference(this object bar) =>...

### Description (optional) Support for `[GeneratedRegex]` attribute. [MS Docs](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.generatedregexattribute?view=net-8.0) ### Rationale This is the new .Net 8 way of having static readonly regexes in code: ```c# [GeneratedRegex(@"^by\(\s*(?[a-zA-Z_][a-zA-Z0-9_]*)\s*\)")] private static partial...

### Rationale The XML documentation of the generated types - at least the types which are directly used by developers - should match the documentation which is available on learn.microsoft.com...

Basically, I just started using PolySharp on a project and find it amazing. Now that project repository is setup to build on Ubuntu runners on github actions and I am...