Search code examples
c#windowsvisual-studio-2012windows-phone-8

"You need to install an app for this task" error with Windows Phone 8 App


My Windows Phone app gives me error "You need to install an app for this task do you want to search it on store?" on app but there's nothing shows up on debugging. if i click on yes it opens store and searching for something and founds nothing. how can I solve this?

edit: it goes away when I disable IsEnabledScript.


Solution

  • Let me try to guess: you are using a WebControl. The page you initially navigate to probably tries to redirect to an URI that has a protocol extension (like facebook://) via Javascript (that explains why you don't have the problem with IsScriptEnabled is false).

    Windows Phone tries to open that link with a native app. If you don't have an app that knows how to handle that protocol, it launches a search on the Store to find an app that does.

    What you can do is subscribe to the Navigating event of the WebBrowser and look where it redirects.

    EDIT :

    In the Navigating event, set e.Cancel to true if you want to stop that behaviour.