[UWP] Unhandled Exception: The application called an interface that was marshalled for a different thread.
See original GitHub issueThe application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)) is raised at the only line in the following method in WorkScheduler.cs;
protected async void TakeFromPendingTasksAndRun()
{
await TakeFromPendingTasksAndRunAsync().ConfigureAwait(false);
}
I have an ItemTemplate for displaying an image;
<ff:FFImage Name="Image"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
TransformPlaceholders="False"
LoadingPlaceholder="ImgLoading.png"
ErrorPlaceholder="ImgError.png"
CacheDuration="30"
RetryCount="3"
RetryDelay="250"
DownsampleToViewSize="True"
DownsampleMode="Default"
Source="{Binding ImageUri}" />
ImageUri is a property on an object that is in an ObservableCollection<T>
Can your help? I’m lost as to how to fix this. Thanks!
Full exception detail is:
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
StackTrace:
at Windows.UI.Xaml.DependencyObject.GetValue(DependencyProperty dp)
at FFImageLoading.FFImage.get_SuccessCommand()
at FFImageLoading.FFImage.OnSuccess(SuccessEventArgs e)
at FFImageLoading.FFImage.<LoadImage>b__12_2(ImageInformation imageInformation, LoadingResult loadingResult)
at FFImageLoading.Work.WorkScheduler.<>c__DisplayClass47_0.<CreateFrameworkTask>b__0(ImageInformation size, LoadingResult result)
at FFImageLoading.Work.ImageLoaderTask`2.<RunAsync>d__109.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at FFImageLoading.Work.WorkScheduler.<RunImageLoadingTaskAsync>d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at FFImageLoading.Work.WorkScheduler.<RunImageLoadingTaskAsync>d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at FFImageLoading.Work.WorkScheduler.<TakeFromPendingTasksAndRunAsync>d__49.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at FFImageLoading.Work.WorkScheduler.<TakeFromPendingTasksAndRun>d__46.MoveNext()```
Issue Analytics
- State:
- Created 7 years ago
- Comments:37 (29 by maintainers)
Top Results From Across the Web
The application called an interface that was marshalled for ...
I'm very new to C# and Windows development, but this is a very long chain of method calls, and kind of feels like...
Read more >The application called an interface that was marshalled for ...
Hello I build UWP with Facebook Login feature. I use winsdkfb.dll for Facebook Login feature. When I click Login game throw error
Read more >Troubleshooting porting Windows Phone Silverlight to UWP
COMException ' occurred in SYSTEM.NI.DLL. Additional information: The application called an interface that was marshalled for a different thread.
Read more >The application called an interface that was marshalled for ...
UWP.Helpers.StiFontHelper' threw an exception.' Exception: The application called an interface that was marshalled for a different thread.
Read more >UWP - UI Thread and Multiple Views - Code4Noobz
In UWP, your “main” application can open a new – separated – view. ... “The application called an interface that was marshalled for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue in the Version 2.2.8. I downgraded Xamarin.FFImageLoading to 2.1.5 and it works now for me.
I’m going to test it between today and tomorrow… I’ll back to you really soon. Thanks!