You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using System.Security.Cryptography.RandomNumberGenerator.GetInt32 on iOS a DLLNotFoundException is thrown.
Exception message: libcoreclr.so
Stacktrace:
at Interop.AppleCrypto.GetRandomBytes(Byte* pbBuffer, Int32 count) in System.Security.Cryptography.Algorithms.dll:token 0x600002e+0x0
at System.Security.Cryptography.RandomNumberGeneratorImplementation.GetBytes(Byte* pbBuffer, Int32 count) in System.Security.Cryptography.Algorithms.dll:token 0x60001c3+0x0
at System.Security.Cryptography.RandomNumberGeneratorImplementation.FillSpan(Span`1 data) in System.Security.Cryptography.Algorithms.dll:token 0x60001bd+0x15
at System.Security.Cryptography.RandomNumberGenerator.GetInt32(Int32 fromInclusive, Int32 toExclusive) in System.Security.Cryptography.Algorithms.dll:token 0x60001e3+0x4b
at System.Security.Cryptography.RandomNumberGenerator.GetInt32(Int32 toExclusive) in System.Security.Cryptography.Algorithms.dll:token 0x60001e4+0x14
Add using Microsoft.Maui.Hosting; in AppDelegate.cs
Add the following code to the constuctor of MainPage var x = RandomNumberGenerator.GetInt32(10);
See it crash when running the app on iOS
Tested on physical iPhone via Hot Restart.
Version with bug
Preview 10 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.1
Did you find any workaround?
Using new Random().Next to generate a random number.
Relevant log output
[0:] An error occurred: 'libcoreclr.so'. Callstack: ' at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f51+0x6a'
The app has been terminated.
The text was updated successfully, but these errors were encountered:
Description
When using
System.Security.Cryptography.RandomNumberGenerator.GetInt32
on iOS aDLLNotFoundException
is thrown.Exception message:
libcoreclr.so
Stacktrace:
No problems on Android or Windows.
Take a look at the Repro.
Steps to Reproduce
var x = RandomNumberGenerator.GetInt32(10);
Tested on physical iPhone via Hot Restart.
Version with bug
Preview 10 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.1
Did you find any workaround?
Using
new Random().Next
to generate a random number.Relevant log output
The text was updated successfully, but these errors were encountered: