Hi I'm building a UWP application (targeting 10240 and Microsoft.NETCore.UniversalWindowsPlatform 6.0.5) and the following simiple code throws an exception:
var ms = new MemoryStream(new byte[16]);
var randomAccessStream = RandomAccessStreamReference.CreateFromStream(ms.AsRandomAccessStream());
var newStream = await randomAccessStream.OpenReadAsync();
This code is throwing the exception:
Message=This IRandomAccessStream does not support the CloneStream method
because it requires cloning and this stream does not support cloning.
Source=System.Runtime.WindowsRuntime
StackTrace:
at System.IO.NetFxToWinRtStreamAdapter.ThrowCloningNotSuported(String methodName)
at System.IO.NetFxToWinRtStreamAdapter.CloneStream()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()