I did debug for target application for 2 times, but now it not works :( I read this Debugging Contracts using Windows Simulator and in this sample: Sharing content target app sample is the same. http://code.msd
n.microsoft.com /windowsapps/Sh aring-Content-T arget-App-e2689 782 http://blogs.ms dn.com/b/visual studio/archive/ 2011/11/01/debu gging-contracts -using-windows- simulator.aspx I have more problems with the share contract, you can see where: http://social.m sdn.microsoft.c om/Forums/en-US /winappswithcsh arp/thread/891f 7aad-3787-485d- ab88-5e3715204c 72/
When I run the share target sample, an exception is thrown at line 99 of MainPage.xaml.c
s: An exception of type 'System.Runtime .InteropService s.COMException' occurred in System.Runtime. WindowsRuntime. dll but was not handled in user code WinRT information: Invoke request processing error. Additional information: Invalid window handle. The line does this: Window.Current. Content = this; Is there a workaround or fix for this?
I've run into this. I narrowed this down to having the main view active (or still not suspended) before invoking the app as a share target. Wait for the main app to get suspended and you shouldnt see this. This is not a very friendly error. Hope someone addresses this.
Getting the same as Oluf N Seems to be related to the await on the line await shareTargetPage
.ActivateAsync( args); I'm assuming something is getting disposed off which in turn causes the window.CurrentC ontext = this; to fail.
I find that target sharing seems to be unstable when the app is running while you perform the share. If you close the target share app (down swipe to close) and then perform target sharing, the operation is stable. If you need your app to be running while performing sharing, because you want the app to do something with the shared data, then alternatives to passing data between the two in memory could be surveyed.
This entry in the forums indicates that it is a known problem. http://social.m
sdn.microsoft.c om/Forums/sr-sp -latn/winappswi thcsharp/thread /21a13cf8-fc84- 49f3-bc32-04af1 b354192