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
I have an object that has a WriteableBitmap property. When deserializing this on WinRT the following exception is thrown. I'm using await when I invoke LoadAsync. Invoking LoadAsync inside dispatcher.RunAsync does not help. Can you help please?
many thanks,
Remco
HResult=-2147417842
Message=The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
Source=Windows.UI.Xaml
StackTrace:
at Windows.UI.Xaml.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight)
at Wintellect.Sterling.WinRT.PlatformAdapter.<GetBitmapSerializer>b__5(BinaryReader br) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.WinRT\PlatformAdapter.cs:line 85
at Wintellect.Sterling.Core.Serialization.ExtendedSerializer.Deserialize(Type type, BinaryReader reader) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\ExtendedSerializer.cs:line 123
at Wintellect.Sterling.Core.Serialization.AggregateSerializer.<>c__DisplayClass7.<CanSerialize>b__4(BinaryReader reader) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\AggregateSerializer.cs:line 79
at Wintellect.Sterling.Core.Serialization.AggregateSerializer.Deserialize(Type type, BinaryReader reader) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\AggregateSerializer.cs:line 148
at Wintellect.Sterling.Core.Serialization.SerializationHelper._Deserialize(BinaryReader br, CycleCache cache) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\SerializationHelper.cs:line 541
at Wintellect.Sterling.Core.Serialization.SerializationHelper._IteratePropertiesUntilEndOfFileIsReached(BinaryReader br, CycleCache cache, Type typeResolved, Object instance) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\SerializationHelper.cs:line 603
at Wintellect.Sterling.Core.Serialization.SerializationHelper.Load(Type type, Object key, BinaryReader br, CycleCache cache) in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Serialization\SerializationHelper.cs:line 473
at Wintellect.Sterling.Core.Database.BaseDatabaseInstance.<_Load>d__44`1.MoveNext() in c:\Users\Remco\Downloads\SterlingDB-master\SterlingDB-master\Wintellect.Sterling.Core\Database\BaseDatabaseInstance.cs:line 774
The text was updated successfully, but these errors were encountered:
I suspect this is related to the recent commit to set ConfigureAwait(false) to avoid a deadlock. This means that the deserialization does no longer necessarily take place on the ui thread (or more specifically in the original captured context). Calling the WriteableBitmap constructor can only be done on the ui thread apparently. I think some core functionality must be changed to allow deserialization to happen asynchronously using a platform specific dispatcher.
my workaround for now is to add SterlingIgnore to the WriteableBitmap property and to add PixelHeight, PixelWidth and PixelBuffer properties. After deserializing I can then create the WriteableBitmap on the ui thread using the PixelHeight, PixelWidth and PixelBuffer properties.
Sorry for your difficulty... I frankly don't have much time to look into this right now, but when my current project slows down a bit I'll get back to it.
Hello,
I have an object that has a WriteableBitmap property. When deserializing this on WinRT the following exception is thrown. I'm using await when I invoke LoadAsync. Invoking LoadAsync inside dispatcher.RunAsync does not help. Can you help please?
many thanks,
Remco
The text was updated successfully, but these errors were encountered: