UWP Windows.System.Launcher.LaunchUriAsync is not opening correctly in browser when the URI supports opening the link in other uwp app and browser.

Harsini 0 Reputation points
2024-09-16T05:48:47.1033333+00:00

Hi

I'm using Windows.System.Launcher.LaunchUriAsync to open a URI, I'm prompted with a dialogue when the URI can be opened in other uwp app and browser.

If chosen browser, it opens the local path - AppData/Local/Microsoft/Windows/INetCache instead of https link, It opens fine when chosen to open with uwp app.

If the default browser happens to be Edge there seems to be no issues and the uri works fine.

Is there any way to open the correct URI in browser when given the choice between UWP app and default browser?

Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,940 questions
Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,042 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
816 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 33,461 Reputation points Microsoft Vendor
    2024-09-17T02:23:38.9433333+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Please make sure that your URI starts with the http Scheme like it is mentioned in here: Launch the default app for a URI.

    Since you didn't share the URI that you are using, a workaround is to open the Edge browser for your URI using microsoft-edge: Scheme no matter what browser is the default one.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.