Skip to content

Commit

Permalink
Fixes the opening of the auth url in the browser in .NetCore
Browse files Browse the repository at this point in the history
Explicitly set UseShellExecute to true, because in .NetFramework the default value is true but in .NetCore the default value changed to false
See: dotnet/winforms#1520 (comment)
and https://github.com/dotnet/corefx/issues/24704
  • Loading branch information
TheBlubb14 committed Oct 19, 2019
1 parent 02739c1 commit 771db12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SpotifyNet/WebAuthorization.cs
Expand Up @@ -45,7 +45,15 @@ public string GetAuthorizationCode(string client_id, string redirect_uri, Scope

using (var server = new Webserver(redirect_uri))
{
Process.Start(uri.ToString());
Process.Start(new ProcessStartInfo(uri.ToString())
{
// Explicitly set UseShellExecute to true,
// because in .NetFramework the default value is true but in
// .NetCore the default value changed to false
// See: https://github.com/dotnet/winforms/issues/1520#issuecomment-515899341
// and https://github.com/dotnet/corefx/issues/24704
UseShellExecute = true
});
result = server.WaitListen();
}

Expand Down

0 comments on commit 771db12

Please sign in to comment.