You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Classic Xamarin.Android (MonoAndroid12.0, etc.), Android for .NET (net6.0-android, etc.)
Affected platform version
MonoAndroid13.0 and net6.0-android
Description
With a project where CA1812 and CA are enforced as errors, the following is observed:
##[error]src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Java.Interop.__TypeRegistrations.cs(16,6): Error CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty<string>() instead.
C:\a\1\s\src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Java.Interop.__TypeRegistrations.cs(16,6): error CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty<string>() instead. [C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.net6.csproj]
##[error]src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Java.Interop.__TypeRegistrations.cs(18,6): Error CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty<Converter<string, Type>>() instead.
C:\a\1\s\src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Java.Interop.__TypeRegistrations.cs(18,6): error CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty<Converter<string, Type>>() instead. [C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.net6.csproj]
##[error]src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Uno.UI.UnoRecyclerView.cs(168,25): Error CA1812: 'UnoRecyclerViewInvoker' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic).
C:\a\1\s\src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Uno.UI.UnoRecyclerView.cs(168,25): error CA1812: 'UnoRecyclerViewInvoker' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). [C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.net6.csproj]
##[error]src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Uno.UI.UnoViewGroup.cs(829,25): Error CA1812: 'UnoViewGroupInvoker' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic).
C:\a\1\s\src\Uno.UI.BindingHelper.Android\obj\Release\net6.0-android\generated\src\Uno.UI.UnoViewGroup.cs(829,25): error CA1812: 'UnoViewGroupInvoker' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). [C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.net6.csproj]
These files should have // <auto-generated/> comment at the top so that Roslyn marks them as auto-generated and skips most analyzers for them.
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.), Android for .NET (net6.0-android, etc.)
Affected platform version
MonoAndroid13.0 and net6.0-android
Description
With a project where CA1812 and CA are enforced as errors, the following is observed:
// <auto-generated/>comment at the top so that Roslyn marks them as auto-generated and skips most analyzers for them.Steps to Reproduce
Did you find any workaround?
No response
Relevant log output
No response