Skip to content

Commit 2f0f5a4

Browse files
committed
Try ignore IL6001
1 parent 6938a35 commit 2f0f5a4

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PropertyGroup>
2727
<!-- Microsoft.Build.Msix.props" cannot be imported again -->
2828
<!-- Found version-specific or distribution-specific runtime identifier(s)-->
29-
<NoWarn>$(NoWarn);NETSDK1206;NU1702</NoWarn>
29+
<NoWarn>$(NoWarn);NETSDK1206;NU1702;IL6001</NoWarn>
3030
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB4011;MSB3277;NETSDK1206;NU1702</MSBuildWarningsAsMessages>
3131
</PropertyGroup>
3232

src/TestUtils/src/Microsoft.Maui.IntegrationTests/Utilities/BuildWarningsUtilities.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,25 @@ public static void AssertWarnings(this List<WarningsPerFile> actualWarnings, Lis
121121
#region Expected warning messages
122122

123123
// IMPORTANT: Always store expected File information as a relative path to the repo ROOT
124-
private static readonly List<WarningsPerFile> expectedNativeAOTWarnings = new();
124+
private static readonly List<WarningsPerFile> expectedNativeAOTWarnings = new()
125+
{
126+
// Example of expected warning
127+
new WarningsPerFile
128+
{
129+
File = "src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
130+
WarningsPerCode = new List<WarningsPerCode>
131+
{
132+
new WarningsPerCode
133+
{
134+
Code = "IL6001",
135+
Messages = new List<string>
136+
{
137+
"ILLink : error IL6001: Assembly 'Xamarin.GooglePlayServices.Tasks' contains reference to obsolete attribute 'Android.Runtime.PreserveAttribute'. Members with this attribute may be trimmed. Please use System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute instead.",
138+
}
139+
}
140+
}
141+
}
142+
};
125143

126144
// Windows-specific expected warnings (if any)
127145
// These might be different from iOS/Mac warnings due to platform-specific implementations

0 commit comments

Comments
 (0)