Skip to content

Commit 8546f1e

Browse files
Empty Blazor Server Project Template (#42079)
* Duplicated Blazor WebAssembly and Blazor Hosted templates * Renaming to reflect file name change * Added files for empty Blazor Server template * Delete Empty WASM Template files * Create EmptyBlazorServerWeb-CSharp.csproj.in * Update launchSettings.json * Update site.css * Removed GUIDs, "Shared" folder, Program.Main.cs * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyBlazorServerWeb-CSharp/wwwroot/css/site.css Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Removed references to Program.Main.cs, reverted HTTPS settings * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyBlazorServerWeb-CSharp/Program.cs Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Added EmptyBlazorServerTest; fixed dismiss formatting * Added blazorserver-empty to template-baselines.json * Remove ProgramMain; name changes * Moved folders for empty template * Revert this (testing CI) * Assert failure logging for missing binlog * Update Project.cs * Update Project.cs * Update MainLayout.razor, Index.razor * Moved empty template test, changed namesapce * Modify to reflect changes in http/https launch profiles * Remove RequiresHttps from template.json * Update EmptyBlazorServerTemplateTest.cs * Update src/ProjectTemplates/Shared/Project.cs Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update Microsoft.DotNet.Web.ProjectTemplates.csproj * Update template.json * Add exclude-launch-settings test * Modified .json files * Move tags to ide.host.json Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
1 parent 34d1f49 commit 8546f1e

33 files changed

+718
-1
lines changed

src/ProjectTemplates/Shared/Project.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ private void CaptureBinLogOnFailure(ProcessEx result)
466466
if (result.ExitCode != 0 && !string.IsNullOrEmpty(ArtifactsLogDir))
467467
{
468468
var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
469-
Assert.True(File.Exists(sourceFile), $"Log for '{ProjectName}' not found in '{sourceFile}'.");
469+
Assert.True(File.Exists(sourceFile), $"Log for '{ProjectName}' not found in '{sourceFile}'. Execution output: {result.Output}");
470470
var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
471471
File.Move(sourceFile, destination, overwrite: true); // binlog will exist on retries
472472
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
8+
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">EmptyBlazorServerWeb_CSharp</RootNamespace>
9+
</PropertyGroup>
10+
11+
</Project>

src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<GeneratedContent Include="EmptyWeb-FSharp.fsproj.in" OutputPath="content/EmptyWeb-FSharp/Company.WebApplication1.fsproj" />
5757
<GeneratedContent Include="GrpcService-CSharp.csproj.in" OutputPath="content/GrpcService-CSharp/GrpcService-CSharp.csproj" />
5858
<GeneratedContent Include="BlazorServerWeb-CSharp.csproj.in" OutputPath="content/BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj" />
59+
<GeneratedContent Include="EmptyBlazorServerWeb-CSharp.csproj.in" OutputPath="content/EmptyBlazorServerWeb-CSharp/EmptyBlazorServerWeb-CSharp.csproj" />
5960
<GeneratedContent Include="RazorPagesWeb-CSharp.csproj.in" OutputPath="content/RazorPagesWeb-CSharp/Company.WebApplication1.csproj" />
6061
<GeneratedContent Include="RazorClassLibrary-CSharp.csproj.in" OutputPath="content/RazorClassLibrary-CSharp/Company.RazorClassLibrary1.csproj" />
6162
<GeneratedContent Include="StarterWeb-CSharp.csproj.in" OutputPath="content/StarterWeb-CSharp/Company.WebApplication1.csproj" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "http://json.schemastore.org/dotnetcli.host",
3+
"symbolInfo": {
4+
"Framework": {
5+
"longName": "framework"
6+
},
7+
"skipRestore": {
8+
"longName": "no-restore",
9+
"shortName": ""
10+
},
11+
"kestrelHttpPort": {
12+
"isHidden": true
13+
},
14+
"kestrelHttpsPort": {
15+
"isHidden": true
16+
},
17+
"iisHttpPort": {
18+
"isHidden": true
19+
},
20+
"iisHttpsPort": {
21+
"isHidden": true
22+
},
23+
"ExcludeLaunchSettings": {
24+
"longName": "exclude-launch-settings",
25+
"shortName": ""
26+
},
27+
"NoHttps": {
28+
"longName": "no-https",
29+
"shortName": ""
30+
}
31+
},
32+
"usageExamples": [
33+
""
34+
]
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json.schemastore.org/ide.host",
3+
"order": 650,
4+
"icon": "ide/icon.png",
5+
"disableHttpsSymbol": "NoHttps",
6+
"supportsDocker": true,
7+
"tags": [
8+
{
9+
"type": "projectType",
10+
"add": [ "Cloud", "Web" ],
11+
"remove": [ "*" ]
12+
},
13+
{
14+
"type": "platform",
15+
"add": [ "Linux", "macOS", "Windows" ]
16+
}
17+
]
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Server App Empty",
4+
"description": "An empty project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template does not have any content in it.",
5+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
6+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
7+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
8+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
9+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
10+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
11+
"symbols/Framework/description": "The target framework for the project.",
12+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
13+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
14+
"postActions/restore/description": "Restore NuGet packages required by this project.",
15+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
16+
}

0 commit comments

Comments
 (0)