Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

We were lucking out previously that this worked with native AOT. With runtime async, this pattern is running out of luck, likely because we're able to optimize more.

In #122526 this test is failing with:

[FAIL] System.Net.Mail.Tests.MailMessageTest.SendMailMessageTest
System.ArgumentNullException : Value cannot be null.
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) in /_/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/MethodInfos/RuntimeNamedMethodInfo.cs:line 134
   at System.Net.Mail.Tests.MailMessageTest.DecodeSentMailMessage(MailMessage mail) in /_/src/libraries/System.Net.Mail/tests/Functional/MailMessageTest.cs:line 268
   at System.Net.Mail.Tests.MailMessageTest.SendMailMessageTest() in /_/src/libraries/System.Net.Mail/tests/Functional/MailMessageTest.cs:line 157
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) in /_/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs:line 230

We were lucking out previously that this worked with native AOT. With runtime async, this pattern is running out of luck, likely because we're able to optimize more.

In #122526 this test is failing with:

```
[FAIL] System.Net.Mail.Tests.MailMessageTest.SendMailMessageTest
System.ArgumentNullException : Value cannot be null.
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) in /_/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/MethodInfos/RuntimeNamedMethodInfo.cs:line 134
   at System.Net.Mail.Tests.MailMessageTest.DecodeSentMailMessage(MailMessage mail) in /_/src/libraries/System.Net.Mail/tests/Functional/MailMessageTest.cs:line 268
   at System.Net.Mail.Tests.MailMessageTest.SendMailMessageTest() in /_/src/libraries/System.Net.Mail/tests/Functional/MailMessageTest.cs:line 157
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) in /_/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/DynamicInvokeInfo.cs:line 230
```
Copilot AI review requested due to automatic review settings February 12, 2026 08:30
@MichalStrehovsky MichalStrehovsky requested review from rzikm and removed request for Copilot February 12, 2026 08:30
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@rzikm rzikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants