Skip to content

Commit

Permalink
Merge pull request #849 from Sergio0694/dev/remove-unnecessary-suppre…
Browse files Browse the repository at this point in the history
…ssions

Remove unnecessary 'IL2059' warning suppression
  • Loading branch information
Sergio0694 authored Sep 9, 2024
2 parents 49f0f6b + bce3d34 commit e4c419d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@
<MvvmToolkitEnableINotifyPropertyChangingSupport>false</MvvmToolkitEnableINotifyPropertyChangingSupport>
</PropertyGroup>

<PropertyGroup>

<!--
Temporary workaround: don't fail builds for 'IL2059' errors, like this:
"XamlTypeInfo.g.cs(495): Trim analysis warning IL2059: ComputeSharp.SwapChain.WinUI.ComputeSharp_SwapChain_WinUI_XamlTypeInfo.XamlTypeInfoProvider.
StaticInitializer_38_Nullable(): Unrecognized value passed to the parameter 'type' of method 'System.Runtime. CompilerServices.RuntimeHelpers
.RunClassConstructor(RuntimeTypeHandle)'. It's not possible to guarantee the availability of the target static constructor."
This is due to a bug in the .NET trim analyzer and in ILC, see: https://github.com/dotnet/runtime/issues/106939.
The best fix would also be to update the XAML compiler in WinAppSDK to skip generating unnecessary static constructor stubs.
-->
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<WarningsNotAsErrors>$(WarningsNotAsErrors);IL2059</WarningsNotAsErrors>
</PropertyGroup>

<!-- Additional CsWinRT properties (temporary, until the .NET SDK is updated) -->
<PropertyGroup>

Expand Down
14 changes: 2 additions & 12 deletions src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,11 @@

<PropertyGroup>

<!--
Disable IIDOptimizer, as it's causing a build error when the debug mode is set to embedded.
This is only needed when generating projections anyway, and not in normal C# class libraries.
See: https://github.com/microsoft/CsWinRT/issues/1478.
-->
<!-- Also disabled in 'ComputeSharp.D2D1.WinUI', see notes there -->
<CsWinRTIIDOptimizerOptOut>true</CsWinRTIIDOptimizerOptOut>

<!--
Ignore some warnings about ambiguous cref attribute references. These are because the assembly defines
blittable bindings for several ABI types from Win2D, in the same namespace as the ABI types from the
CsWinRT projections that are in Win2D. They are internal, but Roslyn will still complain about them.
-->
<!-- Same warnings as in 'ComputeSharp.D2D1.WinUI', see notes there -->
<NoWarn>$(NoWarn);CS0419</NoWarn>

<!-- Ignore warnings for usings outside of a namespace (needed for some WinRT type aliases) -->
<NoWarn>$(NoWarn);IDE0065</NoWarn>

<!-- Temporary workaround: the Win2D .dll is not strong name signed, ignore the error for now -->
Expand Down

0 comments on commit e4c419d

Please sign in to comment.