availableTabs;
try
{
- availableTabs = await GetOpenedBrowserTabs(debuggerHost);
+ availableTabs = await GetOpenedBrowserTabs();
}
catch (Exception ex)
{
@@ -147,28 +237,30 @@ namespace Microsoft.AspNetCore.Builder
var underlyingV8Endpoint = tabToDebug.WebSocketDebuggerUrl;
var proxyEndpoint = $"{request.Host}{request.PathBase}/_framework/debug/ws-proxy?browser={WebUtility.UrlEncode(underlyingV8Endpoint)}";
var devToolsUrlAbsolute = new Uri(debuggerHost + tabToDebug.DevtoolsFrontendUrl);
- var devToolsUrlWithProxy = $"{devToolsUrlAbsolute.Scheme}://{devToolsUrlAbsolute.Authority}{devToolsUrlAbsolute.AbsolutePath}?ws={proxyEndpoint}";
+ var wsParamName = request.IsHttps ? "wss" : "ws";
+ var devToolsUrlWithProxy = $"{devToolsUrlAbsolute.Scheme}://{devToolsUrlAbsolute.Authority}{devToolsUrlAbsolute.AbsolutePath}?{wsParamName}={proxyEndpoint}";
context.Response.Redirect(devToolsUrlWithProxy);
}
private static string GetLaunchChromeInstructions(string appRootUrl)
{
- var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
+ var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug");
+ var debuggerPort = GetDebuggerPort();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return $@"Press Win+R and enter the following:
- chrome --remote-debugging-port=9222 --user-data-dir=""{profilePath}"" {appRootUrl}
";
+ chrome --remote-debugging-port={debuggerPort} --user-data-dir=""{profilePath}"" {appRootUrl}
";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return $@"In a terminal window execute the following:
- google-chrome --remote-debugging-port=9222 --user-data-dir={profilePath} {appRootUrl}
";
+ google-chrome --remote-debugging-port={debuggerPort} --user-data-dir={profilePath} {appRootUrl}
";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return $@"Execute the following:
- open /Applications/Google\ Chrome.app --args --remote-debugging-port=9222 --user-data-dir={profilePath} {appRootUrl}
";
+ open /Applications/Google\ Chrome.app --args --remote-debugging-port={debuggerPort} --user-data-dir={profilePath} {appRootUrl}
";
}
else
{
@@ -178,17 +270,18 @@ namespace Microsoft.AspNetCore.Builder
private static string GetLaunchEdgeInstructions(string appRootUrl)
{
- var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug");
+ var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
+ var debugggerPort = GetDebuggerPort();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return $@"Press Win+R and enter the following:
- msedge --remote-debugging-port=9222 --user-data-dir=""{profilePath}"" {appRootUrl}
";
+ msedge --remote-debugging-port={debugggerPort} --user-data-dir=""{profilePath}"" --no-first-run {appRootUrl}
";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return $@"In a terminal window execute the following:
- open /Applications/Microsoft\ Edge\ Dev.app --args --remote-debugging-port=9222 --user-data-dir={profilePath} {appRootUrl}
";
+ open /Applications/Microsoft\ Edge\ Dev.app --args --remote-debugging-port={debugggerPort} --user-data-dir={profilePath} {appRootUrl}
";
}
else
{
@@ -196,17 +289,24 @@ namespace Microsoft.AspNetCore.Builder
}
}
- private static async Task> GetOpenedBrowserTabs(string debuggerHost)
+ private static async Task GetBrowserVersionInfoAsync()
{
- using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) })
- {
- var jsonResponse = await httpClient.GetStringAsync($"{debuggerHost}/json");
- return JsonConvert.DeserializeObject(jsonResponse);
- }
+ using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
+ var debuggerHost = GetDebuggerHost();
+ return await httpClient.GetStringAsync($"{debuggerHost}/json/version");
+ }
+
+ private static async Task> GetOpenedBrowserTabs()
+ {
+ using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
+ var debuggerHost = GetDebuggerHost();
+ var jsonResponse = await httpClient.GetStringAsync($"{debuggerHost}/json");
+ return JsonSerializer.Deserialize(jsonResponse, JsonOptions);
}
class BrowserTab
{
+ public string Id { get; set; }
public string Type { get; set; }
public string Url { get; set; }
public string Title { get; set; }
diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj b/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj
index c4eb65bded..c855c49821 100644
--- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj
+++ b/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
3.0
diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj b/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj
index 2a77f0c7cc..d849ca9036 100644
--- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj
+++ b/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
7.3
diff --git a/src/Components/Blazor/Validation/src/Microsoft.AspNetCore.Blazor.DataAnnotations.Validation.csproj b/src/Components/Blazor/Validation/src/Microsoft.AspNetCore.Blazor.DataAnnotations.Validation.csproj
index a166d5f1f3..725b1f9811 100644
--- a/src/Components/Blazor/Validation/src/Microsoft.AspNetCore.Blazor.DataAnnotations.Validation.csproj
+++ b/src/Components/Blazor/Validation/src/Microsoft.AspNetCore.Blazor.DataAnnotations.Validation.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
Provides experimental support for validation using DataAnnotations.
true
false
diff --git a/src/Components/Blazor/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj b/src/Components/Blazor/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj
index ef12ac3c4e..e27de695c1 100644
--- a/src/Components/Blazor/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj
+++ b/src/Components/Blazor/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj
@@ -1,7 +1,7 @@

- netstandard2.0
+ netstandard2.1
Exe
true
3.0
@@ -11,17 +11,4 @@