1
votes

I am creating my app as a share source. I have used basic navigation template. Then in the home.js file I added following code.

(function () {  
    "use strict";  

    WinJS.UI.Pages.define("/pages/home/home.html", {  
        // This function is called whenever a user navigates to this page. It
        // populates the page elements with the app's data.  
        ready: function (element, options) {  
            // TODO: Initialize the page here.  
        }  
    });  

    var dataTransferManager =   Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();  
    dataTransferManager.addEventListener("datarequested", dataRequested);  

    function dataRequested(e) {  
        var request = e.request;  
        request.data.properties.title = "Title";  
        request.data.properties.description = "Description";  
        request.data.setText("Test Data");  
        request.data.setUri(new Windows.Foundation.Uri("http://www.microsoft.com"));  
    };  
})();  

For first few times, everything worked fine. If I set a breakpoint in dataRequested method that also get hit. However for some reason then Share stops working. It give me following message

Something went wrong with share. Please Try again later.

If I put breakpoint on dataRequested method, that does not get hit. I clean, rebuild, deploy package again but that does not help. I tried killing WWAHost.exe from task manager without any luck. Uninstalling/installing app and re-starting Visual Studio also doesn't help. I re-start my computer and then same app starts working but after getting to Share charm a few times, it stops working again. Any idea what I could be doing wrong?

1

1 Answers

0
votes

re-starting explorer from task manager fix the issue.