diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs index e353292..d02ccf9 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs @@ -381,12 +381,6 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels { OutputLogger.LogWarning(evt.Data); } - else if (!initializationIsCompleted) - { - _connectionIsReadySource.SetException( - new InvalidOperationException("The Node.js process failed to initialize: " + evt.Data)); - initializationIsCompleted = true; - } else { OnErrorDataReceived(UnencodeNewlines(evt.Data)); @@ -400,10 +394,11 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels private static bool IsDebuggerMessage(string message) { - return message.StartsWith("Debugger attached", StringComparison.OrdinalIgnoreCase) || - message.StartsWith("Debugger listening ", StringComparison.OrdinalIgnoreCase) || - message.StartsWith("To start debugging", StringComparison.OrdinalIgnoreCase) || - message.Equals("Warning: This is an experimental feature and could change at any time.", StringComparison.OrdinalIgnoreCase) || + return message.StartsWith("Debugger attached", StringComparison.Ordinal) || + message.StartsWith("Debugger listening ", StringComparison.Ordinal) || + message.StartsWith("To start debugging", StringComparison.Ordinal) || + message.Equals("Warning: This is an experimental feature and could change at any time.", StringComparison.Ordinal) || + message.Equals("For help see https://nodejs.org/en/docs/inspector", StringComparison.Ordinal) || message.Contains("chrome-devtools:"); } diff --git a/src/Microsoft.AspNetCore.SpaServices/Webpack/ConditionalProxyMiddleware.cs b/src/Microsoft.AspNetCore.SpaServices/Webpack/ConditionalProxyMiddleware.cs index 118e264..ba0cf9f 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Webpack/ConditionalProxyMiddleware.cs +++ b/src/Microsoft.AspNetCore.SpaServices/Webpack/ConditionalProxyMiddleware.cs @@ -98,7 +98,15 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack using (var responseStream = await responseMessage.Content.ReadAsStreamAsync()) { - await responseStream.CopyToAsync(context.Response.Body, DefaultHttpBufferSize, context.RequestAborted); + try + { + await responseStream.CopyToAsync(context.Response.Body, DefaultHttpBufferSize, context.RequestAborted); + } + catch (OperationCanceledException) + { + // The CopyToAsync task will be canceled if the client disconnects (e.g., user + // closes or refreshes the browser tab). Don't treat this as an error. + } } return true; diff --git a/templates/AngularSpa/AngularSpa.csproj b/templates/AngularSpa/AngularSpa.csproj index 8eedd19..4d07626 100644 --- a/templates/AngularSpa/AngularSpa.csproj +++ b/templates/AngularSpa/AngularSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/AureliaSpa/AureliaSpa.csproj b/templates/AureliaSpa/AureliaSpa.csproj index 5c07238..56fde8c 100644 --- a/templates/AureliaSpa/AureliaSpa.csproj +++ b/templates/AureliaSpa/AureliaSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/KnockoutSpa/KnockoutSpa.csproj b/templates/KnockoutSpa/KnockoutSpa.csproj index 5c07238..56fde8c 100644 --- a/templates/KnockoutSpa/KnockoutSpa.csproj +++ b/templates/KnockoutSpa/KnockoutSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/ReactReduxSpa/ReactReduxSpa.csproj b/templates/ReactReduxSpa/ReactReduxSpa.csproj index aa05850..3706db8 100644 --- a/templates/ReactReduxSpa/ReactReduxSpa.csproj +++ b/templates/ReactReduxSpa/ReactReduxSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/ReactSpa/ReactSpa.csproj b/templates/ReactSpa/ReactSpa.csproj index 5c07238..56fde8c 100644 --- a/templates/ReactSpa/ReactSpa.csproj +++ b/templates/ReactSpa/ReactSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/VueSpa/VueSpa.csproj b/templates/VueSpa/VueSpa.csproj index 5c07238..56fde8c 100644 --- a/templates/VueSpa/VueSpa.csproj +++ b/templates/VueSpa/VueSpa.csproj @@ -4,6 +4,7 @@ netcoreapp2.0 TargetFrameworkOverride true + Latest $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; false diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index d5d246e..cb549b5 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -203,6 +203,10 @@ function buildDotNetNewNuGetPackage(packageId: string) { replaces: 'netcoreapp2.0', defaultValue: 'netcoreapp2.0' }, + HostIdentifier: { + type: 'bind', + binding: 'HostIdentifier' + }, skipRestore: { type: 'parameter', datatype: 'bool', @@ -236,6 +240,7 @@ function buildDotNetNewNuGetPackage(packageId: string) { // For the preview2 release, just display manual instructions instead. // This is only applicable on the command line, because VS will restore // NPM packages automatically by default. + condition: '(HostIdentifier == "dotnetcli" || HostIdentifier == "dotnetcli-preview")', actionId: 'AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C', description: '\n\n-------------------------------------------------------------------\nIMPORTANT: Before running this project on the command line,\n you must restore NPM packages by running "npm install"\n-------------------------------------------------------------------\n', manualInstructions: [{ text: 'Run "npm install"' }]