Skip to content

Commit 082a4bf

Browse files
committed
suppress IL2026, IL3050 warning for NativeAOT publish
1 parent ea1d100 commit 082a4bf

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

sandbox/NativeAot/NativeAot.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
<PublishAot>true</PublishAot>
1111
<IsAotCompatible>true</IsAotCompatible>
12+
<PublishTrimmed>true</PublishTrimmed>
13+
<PublishSingleFile>true</PublishSingleFile>
14+
<SelfContained>true</SelfContained>
15+
1216
<Configurations>Debug;Release</Configurations>
1317
</PropertyGroup>
1418

sandbox/NativeAot/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ConsoleAppFramework;
1+
using ConsoleAppFramework;
22
using System.Diagnostics.CodeAnalysis;
33
using System.Runtime.CompilerServices;
44
using System.Text.Json;
@@ -8,6 +8,7 @@
88
ConsoleApp.Run(args, (int x, Kabayaki y) => Console.WriteLine(x + y.MyProperty));
99

1010
app.Run(args);
11+
1112
public class Kabayaki
1213
{
1314
public int MyProperty { get; set; }

src/ConsoleAppFramework/ConsoleAppBaseCode.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ConsoleAppFramework;
1+
namespace ConsoleAppFramework;
22

33
public static class ConsoleAppBaseCode
44
{
@@ -149,6 +149,8 @@ public class ConsoleAppFrameworkGeneratorOptionsAttribute : Attribute
149149
public bool DisableNamingConversion { get; set; }
150150
}
151151
152+
[UnconditionalSuppressMessage("Trimming", "IL2026")]
153+
[UnconditionalSuppressMessage("AOT", "IL3050")]
152154
internal static partial class ConsoleApp
153155
{
154156
public static IServiceProvider? ServiceProvider { get; set; }

0 commit comments

Comments
 (0)