AvaloniaUI / Avalonia.Xaml.Behaviors

Port of Windows UWP Xaml Behaviors for Avalonia Xaml.
MIT License
385 stars 46 forks source link

CS0433 caused by TrimmingAttributes.cs #155

Closed vaLP2eh closed 5 months ago

vaLP2eh commented 5 months ago

src/Avalonia.Xaml.Interactivity/System/Diagnostics/CodeAnalysis/TrimmingAttributes.cs

error CS0433: The type 'RequiresUnreferencedCodeAttribute' exists in both 'Avalonia.Xaml.Interactivity, Version=11.0.10.1, Culture=neutral, PublicKeyToken=e1c1f6030f574d02' and 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

https://learn.microsoft.com/.../CS0433

Please remove these System attributes from your project or make them internal.

wieslawsoltes commented 5 months ago

If I remove we will to drop netstandard2.0 support.

vaLP2eh commented 5 months ago

Why should that happen? .net Standard 2.0 doesn't even support that attribute because it is in your assembly and .net Standard 2.0 doesn't even support trimming at all.

All projects and libraries which have/want to use .net 5 are blocked from using your project due to this.

Anyway. Could you please remove it or make it internal?

Another solution could be to add .net 5 as another target framework of your project and change the condition in your file from #if !NET6_0_OR_GREATER to #if !NET5_0_OR_GREATER.

vaLP2eh commented 5 months ago

I had to add this dirty workaround to my csproj file to get rid of the CS0433: <PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.0.10.1" Aliases="AXI" />

vaLP2eh commented 5 months ago

Anyway. It would be nice if you remove the attributes again or make them internal.

wieslawsoltes commented 5 months ago

Fixed in 11.0.10.2