ngraziano / SharpRTSP

A RTSP handling library
Other
557 stars 182 forks source link

Bug with library Meziantou.Polyfill #101

Closed Revan1985 closed 10 months ago

Revan1985 commented 10 months ago

Hi. there is a bug for the library Meziantou.Polyfill, that affects the netstandard 2.0

In your test programs works all fine, because you are using .net8, but using the .netstandard 2.0 version, you will get the following error Meziantou.Polyfill #33

As workaround, use the following PropertyGroup in the csproj

<PropertyGroup> <MeziantouPolyfill_IncludedPolyfills>T:System.Index|T:System.Range|T:System.Diagnostics.CodeAnalysis|M:System.IO.Stream.ReadAsync|M:System.String.Split|M:System.Text.Encoding.GetString</MeziantouPolyfill_IncludedPolyfills> </PropertyGroup>

ngraziano commented 10 months ago

I was not able to reproduce the problem with a small program .NET 4.8 or 4.7.2 (see the last commit) . Can you give more information ? Which part of code cause issue ?

Revan1985 commented 10 months ago

I don't have a specific code in your library that cause the error. When compiling the RTSP library, i get this error

Severity    Code    Description Project File    Suppression State   Line    Details
Error   CS1501  No overload for method 'GetHashCode' takes 1 arguments  RTSP    D:\Sviluppo\SecurityControlClient_Plugins\RTSP\Meziantou.Polyfill\Meziantou.Polyfill.PolyfillGenerator\T_System.Collections.Generic.ReferenceEqualityComparer.g.cs  Active  58  

But this is not used in any of the code, is just a generated file...

Revan1985 commented 10 months ago

Ok, just my mistake. I have upgraded your library for my work project and I was using netstandard2.0 and v4.72 projects mixed After some refrences change, now works fine.