Browse Source

Components/Blazor template updates (#7709)

* In Blazor hosted template, only UseBlazorDebugging in development environment. Fixes #7275

* Enable HTTPS in the Razor Components template. Fixes #6928

* Reduce Razor Components template to one project. Fixes #6883

* Minor phrasing tweak

* In Razor Components template, change .cshtml to .razor, except _ViewImports.cshtml

* Put back LangVersion

* Update RazorComponentsTemplateTest
Steve Sanderson 7 years ago
parent
commit
895e1c69e0
37 changed files with 84 additions and 135 deletions
  1. 1 1
      src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Startup.cs
  2. 1 2
      src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj
  3. 0 14
      src/ProjectTemplates/Web.ProjectTemplates/RazorComponentsWeb-CSharp.App.csproj.in
  4. 3 5
      src/ProjectTemplates/Web.ProjectTemplates/RazorComponentsWeb-CSharp.csproj.in
  5. 5 25
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/.template.config/template.json
  6. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/App.razor
  7. 1 1
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/Counter.razor
  8. 3 3
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/FetchData.razor
  9. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/Index.razor
  10. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/_ViewImports.cshtml
  11. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Shared/MainLayout.razor
  12. 1 1
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Shared/NavMenu.razor
  13. 12 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Startup.cs
  14. 1 2
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/_ViewImports.cshtml
  15. 1 1
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Program.cs
  16. 35 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Properties/launchSettings.json
  17. 0 20
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs
  18. 0 50
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.sln
  19. 1 1
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Services/WeatherForecast.cs
  20. 1 1
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Services/WeatherForecastService.cs
  21. 18 3
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Startup.cs
  22. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/appsettings.Development.json
  23. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/appsettings.json
  24. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/bootstrap/bootstrap.min.css
  25. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/bootstrap/bootstrap.min.css.map
  26. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/FONT-LICENSE
  27. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/ICON-LICENSE
  28. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/README.md
  29. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
  30. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
  31. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
  32. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
  33. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
  34. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
  35. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/site.css
  36. 0 0
      src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/index.html
  37. 0 5
      src/ProjectTemplates/test/RazorComponentsTemplateTest.cs

+ 1 - 1
src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Startup.cs

@@ -25,6 +25,7 @@ namespace BlazorHosted_CSharp.Server
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();
+                app.UseBlazorDebugging();
             }
 
             app.UseMvc(routes =>
@@ -33,7 +34,6 @@ namespace BlazorHosted_CSharp.Server
             });
 
             app.UseBlazor<Client.Startup>();
-            app.UseBlazorDebugging();
         }
     }
 }

+ 1 - 2
src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

@@ -39,8 +39,7 @@
   <ItemGroup>
     <GeneratedContent Include="EmptyWeb-CSharp.csproj.in" OutputPath="content/EmptyWeb-CSharp/Company.WebApplication1.csproj" />
     <GeneratedContent Include="EmptyWeb-FSharp.fsproj.in" OutputPath="content/EmptyWeb-FSharp/Company.WebApplication1.fsproj" />
-    <GeneratedContent Include="RazorComponentsWeb-CSharp.App.csproj.in" OutputPath="content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/RazorComponentsWeb-CSharp.App.csproj" />
-    <GeneratedContent Include="RazorComponentsWeb-CSharp.Server.csproj.in" OutputPath="content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/RazorComponentsWeb-CSharp.Server.csproj" />
+    <GeneratedContent Include="RazorComponentsWeb-CSharp.csproj.in" OutputPath="content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.csproj" />
     <GeneratedContent Include="RazorPagesWeb-CSharp.csproj.in" OutputPath="content/RazorPagesWeb-CSharp/Company.WebApplication1.csproj" />
     <GeneratedContent Include="RazorClassLibrary-CSharp.csproj.in" OutputPath="content/RazorClassLibrary-CSharp/Company.RazorClassLibrary1.csproj" />
     <GeneratedContent Include="StarterWeb-CSharp.csproj.in" OutputPath="content/StarterWeb-CSharp/Company.WebApplication1.csproj" />

+ 0 - 14
src/ProjectTemplates/Web.ProjectTemplates/RazorComponentsWeb-CSharp.App.csproj.in

@@ -1,14 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Razor">
-
-  <PropertyGroup>
-    <TargetFramework>netstandard2.0</TargetFramework>
-    <LangVersion>7.3</LangVersion>
-    <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">RazorComponentsWeb_CSharp.App</RootNamespace>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="${MicrosoftAspNetCoreComponentsBrowserPackageVersion}" />
-    <PackageReference Include="Microsoft.AspNetCore.Components.Build" Version="${MicrosoftAspNetCoreComponentsBuildPackageVersion}" PrivateAssets="all" />
-  </ItemGroup>
-
-</Project>

+ 3 - 5
src/ProjectTemplates/Web.ProjectTemplates/RazorComponentsWeb-CSharp.Server.csproj.in → src/ProjectTemplates/Web.ProjectTemplates/RazorComponentsWeb-CSharp.csproj.in

@@ -2,14 +2,12 @@
 
   <PropertyGroup>
     <TargetFramework>netcoreapp3.0</TargetFramework>
+    <LangVersion>7.3</LangVersion>
     <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
-    <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">RazorComponentsWeb_CSharp.Server</RootNamespace>
+    <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">RazorComponentsWeb_CSharp</RootNamespace>
+    <_RazorComponentInclude>Components\**\*.cshtml</_RazorComponentInclude>
   </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\RazorComponentsWeb-CSharp.App\RazorComponentsWeb-CSharp.App.csproj" />
-  </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Components.Server" Version="${MicrosoftAspNetCoreComponentsServerPackageVersion}" />
   </ItemGroup>

+ 5 - 25
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/.template.config/template.json

@@ -18,11 +18,6 @@
   },
   "sourceName": "RazorComponentsWeb-CSharp",
   "preferNameDirectory": true,
-  "guids": [
-    "4C26868E-5E7C-458D-82E3-040509D0C71F",
-    "5990939C-7E7B-4CFA-86FF-44CA5756498A",
-    "650B3CE7-2E93-4CC4-9F46-466686815EAA"
-  ],
   "sources": [
     {
       "modifiers": [
@@ -31,12 +26,6 @@
           "exclude": [
             "Properties/launchSettings.json"
           ]
-        },
-        {
-          "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
-          "exclude": [
-            "*.sln"
-          ]
         }
       ]
     }
@@ -48,10 +37,6 @@
       "defaultValue": "false",
       "description": "Whether to exclude launchSettings.json from the generated template."
     },
-    "HostIdentifier": {
-      "type": "bind",
-      "binding": "HostIdentifier"
-    },
     "HttpPort": {
       "type": "parameter",
       "datatype": "integer",
@@ -119,6 +104,10 @@
       "description": "If specified, skips the automatic restore of the project on create.",
       "defaultValue": "false"
     },
+    "RequiresHttps": {
+      "type": "computed",
+      "value": "(!NoHttps)"
+    },
     "NoHttps": {
       "type": "parameter",
       "datatype": "bool",
@@ -128,16 +117,7 @@
   },
   "primaryOutputs": [
     {
-      "condition": "(HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\")",
-      "path": "RazorComponentsWeb-CSharp.sln"
-    },
-    {
-      "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
-      "path": "RazorComponentsWeb-CSharp.Server/RazorComponentsWeb-CSharp.Server.csproj"
-    },
-    {
-      "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
-      "path": "RazorComponentsWeb-CSharp.App/RazorComponentsWeb-CSharp.App.csproj"
+      "path": "RazorComponentsWeb-CSharp.csproj"
     }
   ],
   "defaultName": "WebApplication1",

+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/App.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/App.razor


+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Pages/Counter.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/Counter.razor

@@ -1,4 +1,4 @@
-@page "/counter"
+@page "/counter"
 
 <h1>Counter</h1>
 

+ 3 - 3
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Pages/FetchData.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/FetchData.razor

@@ -1,10 +1,10 @@
-@page "/fetchdata"
-@using RazorComponentsWeb_CSharp.App.Services
+@page "/fetchdata"
+@using RazorComponentsWeb_CSharp.Services
 @inject WeatherForecastService ForecastService
 
 <h1>Weather forecast</h1>
 
-<p>This component demonstrates fetching data from the server.</p>
+<p>This component demonstrates fetching data from a service.</p>
 
 @if (forecasts == null)
 {

+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Pages/Index.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/Index.razor


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Pages/_ViewImports.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Pages/_ViewImports.cshtml


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Shared/MainLayout.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Shared/MainLayout.razor


+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Shared/NavMenu.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Shared/NavMenu.razor

@@ -1,4 +1,4 @@
-<div class="top-row pl-4 navbar navbar-dark">
+<div class="top-row pl-4 navbar navbar-dark">
     <a class="navbar-brand" href="">RazorComponentsWeb-CSharp</a>
     <button class="navbar-toggler" onclick="@ToggleNavMenu">
         <span class="navbar-toggler-icon"></span>

+ 12 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/Startup.cs

@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Components.Builder;
+
+namespace RazorComponentsWeb_CSharp.Components
+{
+    public class Startup
+    {
+        public void Configure(IComponentsApplicationBuilder app)
+        {
+            app.AddComponent<App>("app");
+        }
+    }
+}

+ 1 - 2
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/_ViewImports.cshtml → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Components/_ViewImports.cshtml

@@ -2,5 +2,4 @@
 @using Microsoft.AspNetCore.Components.Layouts
 @using Microsoft.AspNetCore.Components.Routing
 @using Microsoft.JSInterop
-@using RazorComponentsWeb_CSharp.App
-@using RazorComponentsWeb_CSharp.App.Shared
+@using RazorComponentsWeb_CSharp.Components.Shared

+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/Program.cs → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Program.cs

@@ -9,7 +9,7 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 
-namespace RazorComponentsWeb_CSharp.Server
+namespace RazorComponentsWeb_CSharp
 {
     public class Program
     {

+ 35 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Properties/launchSettings.json

@@ -0,0 +1,35 @@
+{
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:8080",
+      //#if(RequiresHttps)
+      "sslPort": 44300
+      //#else
+      "sslPort": 0
+      //#endif
+    }
+  },
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    },
+    "RazorComponentsWeb-CSharp": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      //#if(RequiresHttps)
+      "applicationUrl": "https://localhost:5001;http://localhost:5000",
+      //#else
+      "applicationUrl": "http://localhost:5000",
+      //#endif
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    }
+  }
+}

+ 0 - 20
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs

@@ -1,20 +0,0 @@
-using Microsoft.AspNetCore.Components.Builder;
-using Microsoft.Extensions.DependencyInjection;
-using RazorComponentsWeb_CSharp.App.Services;
-
-namespace RazorComponentsWeb_CSharp.App
-{
-    public class Startup
-    {
-        public void ConfigureServices(IServiceCollection services)
-        {
-            // Example of a data service
-            services.AddSingleton<WeatherForecastService>();
-        }
-
-        public void Configure(IComponentsApplicationBuilder app)
-        {
-            app.AddComponent<App>("app");
-        }
-    }
-}

+ 0 - 50
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.sln

@@ -1,50 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2027
-MinimumVisualStudioVersion = 15.0.26124.0
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorComponentsWeb-CSharp.Server", "RazorComponentsWeb-CSharp.Server\RazorComponentsWeb-CSharp.Server.csproj", "{650B3CE7-2E93-4CC4-9F46-466686815EAA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorComponentsWeb-CSharp.App", "RazorComponentsWeb-CSharp.App\RazorComponentsWeb-CSharp.App.csproj", "{5990939C-7E7B-4CFA-86FF-44CA5756498A}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|x64.Build.0 = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Debug|x86.Build.0 = Debug|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|x64.ActiveCfg = Release|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|x64.Build.0 = Release|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|x86.ActiveCfg = Release|Any CPU
-		{5990939C-7E7B-4CFA-86FF-44CA5756498A}.Release|x86.Build.0 = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|x64.Build.0 = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Debug|x86.Build.0 = Debug|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|Any CPU.Build.0 = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|x64.ActiveCfg = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|x64.Build.0 = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|x86.ActiveCfg = Release|Any CPU
-		{650B3CE7-2E93-4CC4-9F46-466686815EAA}.Release|x86.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {4C26868E-5E7C-458D-82E3-040509D0C71F}
-	EndGlobalSection
-EndGlobal

+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Services/WeatherForecast.cs → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Services/WeatherForecast.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace RazorComponentsWeb_CSharp.App.Services
+namespace RazorComponentsWeb_CSharp.Services
 {
     public class WeatherForecast
     {

+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Services/WeatherForecastService.cs → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Services/WeatherForecastService.cs

@@ -2,7 +2,7 @@ using System;
 using System.Linq;
 using System.Threading.Tasks;
 
-namespace RazorComponentsWeb_CSharp.App.Services
+namespace RazorComponentsWeb_CSharp.Services
 {
     public class WeatherForecastService
     {

+ 18 - 3
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/Startup.cs → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Startup.cs

@@ -5,10 +5,14 @@ using System.Threading.Tasks;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
+#if (RequiresHttps)
+using Microsoft.AspNetCore.HttpsPolicy;
+#endif
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
+using RazorComponentsWeb_CSharp.Services;
 
-namespace RazorComponentsWeb_CSharp.Server
+namespace RazorComponentsWeb_CSharp
 {
     public class Startup
     {
@@ -16,7 +20,8 @@ namespace RazorComponentsWeb_CSharp.Server
         // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
         public void ConfigureServices(IServiceCollection services)
         {
-            services.AddRazorComponents<App.Startup>();
+            services.AddSingleton<WeatherForecastService>();
+            services.AddRazorComponents<Components.Startup>();
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -26,9 +31,19 @@ namespace RazorComponentsWeb_CSharp.Server
             {
                 app.UseDeveloperExceptionPage();
             }
+#if (RequiresHttps)
+            else
+            {
+                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+                app.UseHsts();
+            }
+#endif
 
+#if (RequiresHttps)
+            app.UseHttpsRedirection();
+#endif
             app.UseStaticFiles();
-            app.UseRazorComponents<App.Startup>();
+            app.UseRazorComponents<Components.Startup>();
         }
     }
 }

+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/appsettings.Development.json → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/appsettings.Development.json


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/appsettings.json → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/appsettings.json


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/bootstrap/bootstrap.min.css → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/bootstrap/bootstrap.min.css


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/bootstrap/bootstrap.min.css.map → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/bootstrap/bootstrap.min.css.map


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/FONT-LICENSE → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/FONT-LICENSE


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/ICON-LICENSE → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/ICON-LICENSE


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/README.md → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/README.md


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/fonts/open-iconic.eot → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/fonts/open-iconic.otf → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/fonts/open-iconic.svg → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.svg


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/open-iconic/font/fonts/open-iconic.woff → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/css/site.css → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/css/site.css


+ 0 - 0
src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.Server/wwwroot/index.html → src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/wwwroot/index.html


+ 0 - 5
src/ProjectTemplates/test/RazorComponentsTemplateTest.cs

@@ -22,11 +22,6 @@ namespace Templates.Test
         public void RazorComponentsTemplateWorks()
         {
             RunDotNetNew("razorcomponents");
-
-            // Run the "server" project
-            ProjectName += ".Server";
-            TemplateOutputDir = Path.Combine(TemplateOutputDir, ProjectName);
-
             TestApplication(publish: false);
             TestApplication(publish: true);
         }