Photo App is not sharing the file to the share target? RRS feed

  • Question

  • Hi,

    I have created a C# Windows 8.1 store app with Share Target declaration for the following file types TIFF, JPEG, PNG etc., After deployment, I have tried to share some images(tiff/jpg/png) from Photos app. But I am not able to receive the file the getfileasync() is failed and catched exception. Please let me know is it the default behavior or bug because I have read some information from the below link: http://gcoupe.wordpress.com/2013/07/03/windows-8-1-photo-app/



    Friday, November 15, 2013 1:25 PM

All replies

  • I'm not on a dev system and cant test this myself, but can you successfully share to the share target sample? My first test whenever I have sharing problems os to compare the behavior in the share target and source samples and examine what data is actually available.


    Friday, November 15, 2013 3:59 PM
  • Pretty sure this is the identical question I asked 2 months ago, and reposted just a few days ago. We are days from shipping and cannot get sharing to work reliably from either the Photos or Skydrive app due to the same issue...

    This is easy to repro, just follow the instructions for modifying that share target sample in my post...


    FreshPaint handles it fine so they figured it out, please enlighten the rest of us so all the apps can play nice together the way win8 was conceived.  Also, the facebook app was working fine sharing until they posted an update on the 14th, now it does not share with any app. Ugh!! The Twitter app fails to share with anyone, and de-authenticates your account and logs you out.

    Saturday, November 16, 2013 2:20 PM
  • I see this same behavior with the Photos app as a Share Source. Here's the simplest repro I can think of.


    using Windows.ApplicationModel.Activation;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    namespace App1
    	sealed partial class App : Application
    		public App()
    		protected override void OnLaunched(LaunchActivatedEventArgs e)
    			var frame = new Frame();
    			Window.Current.Content = frame;
    		protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
    			var frame = new Frame();
    			Window.Current.Content = frame;
    			frame.Navigate(typeof(SharePage), args.ShareOperation);




    using System;
    using Windows.ApplicationModel.DataTransfer.ShareTarget;
    using Windows.Storage;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Navigation;
    namespace App1
    	public sealed partial class SharePage : Page
    		public SharePage()
    		protected async override void OnNavigatedTo(NavigationEventArgs e)
    			var op = (ShareOperation)e.Parameter;
    			var items = await op.Data.GetStorageItemsAsync();
    			var file = (StorageFile)items[0];
    			var stream = await file.OpenReadAsync(); // this line causes the crash


    <?xml version="1.0" encoding="utf-8"?>
    <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
      <Identity Name="45c9b9f7-c6d5-41cb-b40a-7a512041b153" Publisher="CN=Mark" Version="" />
        <Resource Language="x-generate" />
        <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="App1.App">
          <m2:VisualElements DisplayName="App1" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png" Description="App1" ForegroundText="light" BackgroundColor="#464646">
            <m2:SplashScreen Image="Assets\SplashScreen.png" />
            <Extension Category="windows.shareTarget">
                  <SupportsAnyFileType />
        <Capability Name="internetClient" />

    If I run the target app under the debugger, use Photos as the Share Source, then I get this exception:

    {"A COM call to an ASTA was blocked because the call chain originated in or passed through another ASTA. This call pattern is deadlock-prone and disallowed by apartment call control.\r\n\r\nA COM call (IID: {33EE3134-1DD6-4E3A-8067-D1C162E8642B}, method index: 6) to an ASTA (thread 5684) was blocked because the call chain originated in or passed through another ASTA (thread 12492). This call pattern is deadlock-prone and disallowed by apartment call control."}

    If I write my own Share Source, it works fine, no exception:

        public sealed partial class MainPage : Page
            public MainPage()
    			DataTransferManager.GetForCurrentView().DataRequested += MainPage_DataRequested;
    		async void MainPage_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
    			var deferral = args.Request.GetDeferral();
    			var file = await KnownFolders.PicturesLibrary.GetFileAsync("Star.jpg");
    			var items = new List<IStorageItem>();
    			args.Request.Data.Properties.Title = "MyTitle";
    Any thoughts appreciated, I never programmed COM so it is hard for me to decode that error message. Thanks!
    Thursday, May 1, 2014 2:13 AM