From 0f8fdad593ad0220878b1b62b66394a029b3cfe5 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 25 Jul 2018 09:32:49 -0700 Subject: [PATCH] Further 0.5.0 tweaks (#1191) * Clarify debug instructions further * Fix error message * Add "using Microsoft.JSInterop" in templates * Clarify template descriptions --- .../MonoDebugProxy/MonoDebugProxyAppBuilderExtensions.cs | 6 +++--- .../.template.config.src/vs-2017.3.host.json | 2 +- .../BlazorHosted-CSharp.Client/_ViewImports.cshtml | 3 ++- .../.template.config.src/vs-2017.3.host.json | 2 +- .../BlazorServerSide-CSharp.App/_ViewImports.cshtml | 3 ++- .../.template.config.src/vs-2017.3.host.json | 2 +- .../content/BlazorStandalone-CSharp/_ViewImports.cshtml | 3 ++- .../JavaScriptRuntime/src/Microsoft.JSInterop.ts | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.AspNetCore.Blazor.Server/MonoDebugProxy/MonoDebugProxyAppBuilderExtensions.cs b/src/Microsoft.AspNetCore.Blazor.Server/MonoDebugProxy/MonoDebugProxyAppBuilderExtensions.cs index 041ddafa6c..e67bf174d7 100644 --- a/src/Microsoft.AspNetCore.Blazor.Server/MonoDebugProxy/MonoDebugProxyAppBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Blazor.Server/MonoDebugProxy/MonoDebugProxyAppBuilderExtensions.cs @@ -138,17 +138,17 @@ namespace Microsoft.AspNetCore.Builder { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - return $@"

Close this browser, then press Win+R and enter the following:

+ return $@"

Close all Chrome instances, then press Win+R and enter the following:

""%programfiles(x86)%\Google\Chrome\Application\chrome.exe"" --remote-debugging-port=9222 {appRootUrl}

"; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - return $@"

Close this browser, then in a terminal window execute the following:

+ return $@"

Close all Chrome instances, then in a terminal window execute the following:

google-chrome --remote-debugging-port=9222 {appRootUrl}

"; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - return $@"

Close this browser, then in a terminal window execute the following:

+ return $@"

Close all Chrome instances, then in a terminal window execute the following:

open /Applications/Google\ Chrome.app --args --remote-debugging-port=9222 {appRootUrl}

"; } else diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/.template.config.src/vs-2017.3.host.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/.template.config.src/vs-2017.3.host.json index 440039c6b4..11baf5bf46 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/.template.config.src/vs-2017.3.host.json +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/.template.config.src/vs-2017.3.host.json @@ -6,7 +6,7 @@ "id": "1050" }, "description": { - "text": "A project template for creating an ASP.NET Core Blazor application", + "text": "A project template for creating a Blazor application that runs on WebAssembly and is hosted on an ASP.NET Core server.", "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}", "id": "1051" }, diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/_ViewImports.cshtml b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/_ViewImports.cshtml index 3f34b12e5e..d281a74fb2 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/_ViewImports.cshtml +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/_ViewImports.cshtml @@ -1,5 +1,6 @@ -@using System.Net.Http +@using System.Net.Http @using Microsoft.AspNetCore.Blazor.Layouts @using Microsoft.AspNetCore.Blazor.Routing +@using Microsoft.JSInterop @using BlazorHosted_CSharp.Client @using BlazorHosted_CSharp.Client.Shared diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/.template.config.src/vs-2017.3.host.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/.template.config.src/vs-2017.3.host.json index 8b3fcaab16..37b33d30b0 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/.template.config.src/vs-2017.3.host.json +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/.template.config.src/vs-2017.3.host.json @@ -6,7 +6,7 @@ "id": "1050" }, "description": { - "text": "A project template for creating an ASP.NET Core Blazor application", + "text": "A project template for creating a Blazor application that runs server-side inside an ASP.NET Core application.", "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}", "id": "1051" }, diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/BlazorServerSide-CSharp.App/_ViewImports.cshtml b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/BlazorServerSide-CSharp.App/_ViewImports.cshtml index d6922bfc19..a3225fb116 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/BlazorServerSide-CSharp.App/_ViewImports.cshtml +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorServerSide-CSharp/BlazorServerSide-CSharp.App/_ViewImports.cshtml @@ -1,5 +1,6 @@ -@using System.Net.Http +@using System.Net.Http @using Microsoft.AspNetCore.Blazor.Layouts @using Microsoft.AspNetCore.Blazor.Routing +@using Microsoft.JSInterop @using BlazorServerSide_CSharp.App @using BlazorServerSide_CSharp.App.Shared diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/.template.config.src/vs-2017.3.host.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/.template.config.src/vs-2017.3.host.json index 225eae3954..c7489ae90f 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/.template.config.src/vs-2017.3.host.json +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/.template.config.src/vs-2017.3.host.json @@ -6,7 +6,7 @@ "id": "1050" }, "description": { - "text": "A project template for creating an ASP.NET Core Blazor application", + "text": "A project template for creating a standalone Blazor application that runs on WebAssembly.", "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}", "id": "1051" }, diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/_ViewImports.cshtml b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/_ViewImports.cshtml index 10f9381e1a..6a845c243c 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/_ViewImports.cshtml +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone-CSharp/_ViewImports.cshtml @@ -1,5 +1,6 @@ -@using System.Net.Http +@using System.Net.Http @using Microsoft.AspNetCore.Blazor.Layouts @using Microsoft.AspNetCore.Blazor.Routing +@using Microsoft.JSInterop @using BlazorStandalone_CSharp @using BlazorStandalone_CSharp.Shared diff --git a/src/Microsoft.JSInterop/JavaScriptRuntime/src/Microsoft.JSInterop.ts b/src/Microsoft.JSInterop/JavaScriptRuntime/src/Microsoft.JSInterop.ts index b18e501c86..4b5d409d0f 100644 --- a/src/Microsoft.JSInterop/JavaScriptRuntime/src/Microsoft.JSInterop.ts +++ b/src/Microsoft.JSInterop/JavaScriptRuntime/src/Microsoft.JSInterop.ts @@ -62,7 +62,7 @@ module DotNet { const resultJson = dispatcher.invokeDotNetFromJS(assemblyName, methodIdentifier, dotNetObjectId, argsJson); return resultJson ? parseJsonWithRevivers(resultJson) : null; } else { - throw new Error('The current dispatcher does not support synchronous calls from JS to .NET. Use invokeAsync instead.'); + throw new Error('The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.'); } }