From eb727c0464d58ec7bc5166354b43d2ac2e4fd705 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 15 Mar 2018 16:29:33 +0000 Subject: [PATCH] In standalone template, generate a launchSettings.json that doesn't have IISExpress. Fixes #235 --- ...icrosoft.AspNetCore.Blazor.Templates.nuspec | 2 +- .../.template.config/template.json | 18 ++++++++++++++++++ .../.template.config/vs-2017.3.host.json | 6 ++++++ .../Properties/launchSettings.json | 12 ++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/Properties/launchSettings.json diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.nuspec b/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.nuspec index c7d10cc9ea..f5c607e7c3 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.nuspec +++ b/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.nuspec @@ -19,7 +19,7 @@ diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/template.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/template.json index 597843e00b..010fdd93c6 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/template.json +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/template.json @@ -43,6 +43,24 @@ "type": "bind", "binding": "HostIdentifier" }, + "HttpPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the HTTP endpoint in launchSettings.json." + }, + "HttpPortGenerated": { + "type": "generated", + "generator": "port" + }, + "HttpPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "HttpPort", + "fallbackVariableName": "HttpPortGenerated" + }, + "replaces": "61501" + }, "skipRestore": { "type": "parameter", "datatype": "bool", diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/vs-2017.3.host.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/vs-2017.3.host.json index 225eae3954..75d60608c2 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/vs-2017.3.host.json +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/.template.config/vs-2017.3.host.json @@ -15,5 +15,11 @@ "learnMoreLink": "https://github.com/aspnet/blazor", "uiFilters": [ "oneaspnet" + ], + "ports": [ + { + "name": "HttpPort", + "useHttps": false + } ] } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/Properties/launchSettings.json b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/Properties/launchSettings.json new file mode 100644 index 0000000000..950b98ed92 --- /dev/null +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorStandalone.CSharp/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "BlazorStandalone.CSharp": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:61501/" + } + } +} \ No newline at end of file