diff --git a/eng/Build.props b/eng/Build.props index f8a3b7027a..450f8731ad 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -35,7 +35,7 @@ $(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj; $(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj; $(RepoRoot)src\Components\Blazor\Build\testassets\**\*.*proj; - $(RepoRoot)src\Components\Blazor\Templates\src\content\**\*.*proj; + $(RepoRoot)src\ProjectTemplates\BlazorWasm.ProjectTemplates\content\**\*.csproj; $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj; $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj; $(RepoRoot)src\ProjectTemplates\Web.Spa.ProjectTemplates\content\**\*.csproj; diff --git a/src/Components/Blazor/Templates/src/Directory.Build.props b/src/Components/Blazor/Templates/src/Directory.Build.props deleted file mode 100644 index ed5e015014..0000000000 --- a/src/Components/Blazor/Templates/src/Directory.Build.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - false - false - - - - - 0.8.0-preview-19064-0339 - 3.0.0-preview-19064-0339 - - - diff --git a/src/Components/Blazor/Templates/src/Directory.Build.targets b/src/Components/Blazor/Templates/src/Directory.Build.targets deleted file mode 100644 index 7c6f423add..0000000000 --- a/src/Components/Blazor/Templates/src/Directory.Build.targets +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - TemplateBlazorVersion=$(PackageVersion); - TemplateComponentsVersion=$(ComponentsPackageVersion); - RepositoryCommit=$(SourceRevisionId); - - - - diff --git a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj deleted file mode 100644 index c91a32128d..0000000000 --- a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - netstandard2.0 - Microsoft.AspNetCore.Blazor.Templates.nuspec - true - False - False - False - false - none - false - $(NoWarn);2008 - Templates for ASP.NET Core Blazor projects. - aspnet;templates;blazor;spa - false - - - - - - - - - <_TemplateConfigMainFile Include="content\**\.template.config.src\template.json" /> - <_TemplateConfigDir Include="@(_TemplateConfigMainFile->'$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigMainFile.FullPath)'))')" /> - <_TemplateConfigFileToCopy Include="%(_TemplateConfigDir.Identity)\**\*.*"> - $([System.IO.Path]::GetDirectoryName('%(_TemplateConfigDir.Identity)'))\.template.config\ - - - - - - - - - - - - - - %(DestDir)%(RecursiveDir)%(Filename)%(Extension) - $(GeneratedContentProperties) - - - - - - - - - diff --git a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.nuspec b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.nuspec deleted file mode 100644 index fd19750231..0000000000 --- a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.nuspec +++ /dev/null @@ -1,16 +0,0 @@ - - - - $CommonMetadataElements$ - - - - - - $CommonFileElements$ - - - diff --git a/src/Components/Components.sln b/src/Components/Components.sln index 36cde86285..b4d1840025 100644 --- a/src/Components/Components.sln +++ b/src/Components/Components.sln @@ -25,8 +25,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Server", "Blazor\Server\src\Microsoft.AspNetCore.Blazor.Server.csproj", "{A4859630-F9F7-4F5C-9FF3-6C013D7C58FA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Templates", "Blazor\Templates\src\Microsoft.AspNetCore.Blazor.Templates.csproj", "{66036B70-6C93-4E45-A1A1-819F15CA757A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{A7ABAC29-F73F-456D-AE54-46842CFC2E10}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostedInAspNet.Client", "Blazor\testassets\HostedInAspNet.Client\HostedInAspNet.Client.csproj", "{FD37F740-A654-4117-BFB6-9112CE4C1D3B}" @@ -248,7 +246,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mono.WebAssembly.Interop", "Mono.WebAssembly.Interop", "{21BB9C13-20C1-4F2B-80E4-D7C64AA3BD05}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.WebAssembly.Interop", "Blazor\Mono.WebAssembly.Interop\src\Mono.WebAssembly.Interop.csproj", "{D141CFEE-D10A-406B-8963-F86FA13732E3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.WebAssembly.Interop", "Blazor\Mono.WebAssembly.Interop\src\Mono.WebAssembly.Interop.csproj", "{D141CFEE-D10A-406B-8963-F86FA13732E3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -368,18 +366,6 @@ Global {A4859630-F9F7-4F5C-9FF3-6C013D7C58FA}.Release|x64.Build.0 = Release|Any CPU {A4859630-F9F7-4F5C-9FF3-6C013D7C58FA}.Release|x86.ActiveCfg = Release|Any CPU {A4859630-F9F7-4F5C-9FF3-6C013D7C58FA}.Release|x86.Build.0 = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|x64.ActiveCfg = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|x64.Build.0 = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|x86.ActiveCfg = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Debug|x86.Build.0 = Debug|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|Any CPU.Build.0 = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|x64.ActiveCfg = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|x64.Build.0 = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|x86.ActiveCfg = Release|Any CPU - {66036B70-6C93-4E45-A1A1-819F15CA757A}.Release|x86.Build.0 = Release|Any CPU {FD37F740-A654-4117-BFB6-9112CE4C1D3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD37F740-A654-4117-BFB6-9112CE4C1D3B}.Debug|Any CPU.Build.0 = Debug|Any CPU {FD37F740-A654-4117-BFB6-9112CE4C1D3B}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1546,7 +1532,6 @@ Global {A6C8050D-7C18-4585-ADCF-833AC1765847} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {08773DD6-6FED-4BF2-BD9F-C19D2CF919BB} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {A4859630-F9F7-4F5C-9FF3-6C013D7C58FA} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} - {66036B70-6C93-4E45-A1A1-819F15CA757A} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {A7ABAC29-F73F-456D-AE54-46842CFC2E10} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF} {FD37F740-A654-4117-BFB6-9112CE4C1D3B} = {A7ABAC29-F73F-456D-AE54-46842CFC2E10} {C1E2C117-BE47-4E29-94B3-753262D97A5C} = {A7ABAC29-F73F-456D-AE54-46842CFC2E10} diff --git a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/.gitignore b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/.gitignore new file mode 100644 index 0000000000..9310b1ea52 --- /dev/null +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/.gitignore @@ -0,0 +1,3 @@ +# This file is generated by the build +content/*/*.*proj +content/*/*/*.*proj diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Client.csproj.in similarity index 67% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Client.csproj.in index c855c49821..70927b08e3 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/BlazorWasm-CSharp.Client.csproj +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Client.csproj.in @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/BlazorWasm-CSharp.Server.csproj b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Server.csproj.in similarity index 71% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/BlazorWasm-CSharp.Server.csproj rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Server.csproj.in index eb9834dd9b..5fe7473679 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/BlazorWasm-CSharp.Server.csproj +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Server.csproj.in @@ -1,12 +1,11 @@  - $(DefaultNetCoreTargetFramework) - 7.3 + ${DefaultNetCoreTargetFramework} - + diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Shared.csproj.in similarity index 79% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Shared.csproj.in index d849ca9036..d4c395e8cb 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/BlazorWasm-CSharp.Shared.csproj +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/BlazorWasm-CSharp.Shared.csproj.in @@ -2,7 +2,6 @@ netstandard2.1 - 7.3 diff --git a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/Microsoft.AspNetCore.Blazor.Templates.csproj b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/Microsoft.AspNetCore.Blazor.Templates.csproj new file mode 100644 index 0000000000..32c3197d04 --- /dev/null +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/Microsoft.AspNetCore.Blazor.Templates.csproj @@ -0,0 +1,41 @@ + + + $(DefaultNetCoreTargetFramework) + true + Templates for ASP.NET Core Blazor projects. + $(PackageTags);blazor;spa + + + + + + DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework); + MicrosoftAspNetCoreBlazorPackageVersion=$(MicrosoftAspNetCoreBlazorPackageVersion); + MicrosoftAspNetCoreBlazorBuildPackageVersion=$(MicrosoftAspNetCoreBlazorBuildPackageVersion); + MicrosoftAspNetCoreBlazorDevServerPackageVersion=$(MicrosoftAspNetCoreBlazorDevServerPackageVersion); + MicrosoftAspNetCoreBlazorHttpClientPackageVersion=$(MicrosoftAspNetCoreBlazorHttpClientPackageVersion); + MonoWebAssemblyInteropPackageVersion=$(MonoWebAssemblyInteropPackageVersion); + MicrosoftEntityFrameworkCoreSqlServerPackageVersion=$(MicrosoftEntityFrameworkCoreSqlServerPackageVersion); + MicrosoftAspNetCoreBlazorServerPackageVersion=$(MicrosoftAspNetCoreBlazorServerPackageVersion); + + + $(RepoRoot)src\Components\Blazor\ + + + + + + + + + + + + + + + + + + + diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/dotnetcli.host.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/dotnetcli.host.json similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/dotnetcli.host.json rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/dotnetcli.host.json diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/icon.png b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/icon.png similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/icon.png rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/icon.png diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/template.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json similarity index 86% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/template.json rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json index 119303324e..3297878253 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/template.json +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json @@ -1,13 +1,16 @@ { + "$schema": "http://json.schemastore.org/template", "author": "Microsoft", "classifications": [ "Web", "Blazor", "WebAssembly" ], + "name": "Blazor WebAssembly App", "defaultName": "WebApplication", "description": "A project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template can be used for web apps with rich dynamic user interfaces (UIs).", "groupIdentity": "Microsoft.Web.Blazor.Wasm", + "precedence": "6001", "guids": [ "4C26868E-5E7C-458D-82E3-040509D0C71F", "5990939C-7E7B-4CFA-86FF-44CA5756498A", @@ -15,7 +18,6 @@ "0AFFA7FD-4E37-4636-AB91-3753E746DB98" ], "identity": "Microsoft.Web.Blazor.Wasm.CSharp", - "name": "Blazor WebAssembly App", "preferNameDirectory": true, "primaryOutputs": [ { @@ -94,20 +96,6 @@ "type": "bind", "binding": "HostIdentifier" }, - "TemplateBlazorVersionSymbol": { - "type": "parameter", - "datatype": "string", - "description": "Specifies which version of Blazor packages to use.", - "replaces": "$(TemplateBlazorPackageVersion)", - "defaultValue": "${TemplateBlazorVersion}" - }, - "TemplateComponentsVersionSymbol": { - "type": "parameter", - "datatype": "string", - "description": "Specifies which version of Components packages to use.", - "replaces": "$(TemplateComponentsPackageVersion)", - "defaultValue": "${TemplateComponentsVersion}" - }, "skipRestore": { "type": "parameter", "datatype": "bool", @@ -146,7 +134,7 @@ } ], "args": { - "files": [ "BlazorWasm-CSharp.Client.csproj" ] + "files": ["BlazorWasm-CSharp.Client.csproj"] }, "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", "continueOnError": true diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/vs-2017.3.host.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/vs-2017.3.host.json similarity index 92% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/vs-2017.3.host.json rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/vs-2017.3.host.json index 4d0b04c1b3..5cb50d10a5 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/.template.config.src/vs-2017.3.host.json +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/vs-2017.3.host.json @@ -11,7 +11,7 @@ }, "order": 610, "icon": "icon.png", - "learnMoreLink": "https://github.com/aspnet/blazor", + "learnMoreLink": "https://github.com/aspnet/AspNetCore", "uiFilters": [ "oneaspnet" ], diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/BlazorWasm-CSharp.sln b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/BlazorWasm-CSharp.sln similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/BlazorWasm-CSharp.sln rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/BlazorWasm-CSharp.sln diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/App.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/App.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/App.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/App.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/Counter.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/Counter.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/Counter.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/Counter.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/FetchData.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/FetchData.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/FetchData.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/FetchData.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/Index.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/Index.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/Index.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Pages/Index.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Program.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Program.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Program.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Program.cs diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/MainLayout.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/MainLayout.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/MainLayout.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/MainLayout.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/NavMenu.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/NavMenu.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/NavMenu.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/NavMenu.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/SurveyPrompt.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/SurveyPrompt.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Shared/SurveyPrompt.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Shared/SurveyPrompt.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Startup.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Startup.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Startup.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/Startup.cs diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/_Imports.razor b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/_Imports.razor similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/_Imports.razor rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/_Imports.razor diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css.map b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css.map similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css.map rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/bootstrap/bootstrap.min.css.map diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/FONT-LICENSE b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/FONT-LICENSE similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/FONT-LICENSE rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/FONT-LICENSE diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/ICON-LICENSE b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/ICON-LICENSE similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/ICON-LICENSE rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/ICON-LICENSE diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/README.md b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/README.md similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/README.md rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/README.md diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.svg similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.svg rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.svg diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/site.css b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/site.css similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/css/site.css rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/css/site.css diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/index.html b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/index.html similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/index.html rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/index.html diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/sample-data/weather.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/sample-data/weather.json similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/wwwroot/sample-data/weather.json rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Client/wwwroot/sample-data/weather.json diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Controllers/WeatherForecastController.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Controllers/WeatherForecastController.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Controllers/WeatherForecastController.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Controllers/WeatherForecastController.cs diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Program.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Program.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Program.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Program.cs diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Startup.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Startup.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Server/Startup.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Server/Startup.cs diff --git a/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/WeatherForecast.cs b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Shared/WeatherForecast.cs similarity index 100% rename from src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Shared/WeatherForecast.cs rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/Shared/WeatherForecast.cs diff --git a/src/Components/Blazor/Templates/src/content/Directory.Build.props b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/Directory.Build.props similarity index 100% rename from src/Components/Blazor/Templates/src/content/Directory.Build.props rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/Directory.Build.props diff --git a/src/Components/Blazor/Templates/src/content/Directory.Build.targets b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/Directory.Build.targets similarity index 100% rename from src/Components/Blazor/Templates/src/content/Directory.Build.targets rename to src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/Directory.Build.targets diff --git a/src/ProjectTemplates/ProjectTemplates.sln b/src/ProjectTemplates/ProjectTemplates.sln index da18f3a2e5..7628d8233d 100644 --- a/src/ProjectTemplates/ProjectTemplates.sln +++ b/src/ProjectTemplates/ProjectTemplates.sln @@ -177,6 +177,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ApiAut EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "..\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Blazor.Templates", "BlazorWasm.ProjectTemplates\Microsoft.AspNetCore.Blazor.Templates.csproj", "{C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1231,6 +1233,18 @@ Global {06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x64.Build.0 = Release|Any CPU {06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.ActiveCfg = Release|Any CPU {06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.Build.0 = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|x64.ActiveCfg = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|x64.Build.0 = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|x86.ActiveCfg = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Debug|x86.Build.0 = Debug|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|Any CPU.Build.0 = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|x64.ActiveCfg = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|x64.Build.0 = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|x86.ActiveCfg = Release|Any CPU + {C6D371A8-D8EA-4CF4-844E-8C6DFDF61642}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ProjectTemplates/test/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/test/BlazorWasmTemplateTest.cs new file mode 100644 index 0000000000..579d5b11bf --- /dev/null +++ b/src/ProjectTemplates/test/BlazorWasmTemplateTest.cs @@ -0,0 +1,155 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Net; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; +using OpenQA.Selenium; +using Templates.Test.Helpers; +using Xunit; +using Xunit.Abstractions; + +namespace Templates.Test +{ + public class BlazorWasmTemplateTest : BrowserTestBase + { + public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) + : base(browserFixture, output) + { + ProjectFactory = projectFactory; + } + + public ProjectFactoryFixture ProjectFactory { get; set; } + + [Fact] + public async Task BlazorWasmStandaloneTemplate_Works() + { + var project = await ProjectFactory.GetOrCreateProject("blazorstandalone", Output); + + var createResult = await project.RunDotNetNewAsync("blazorwasm"); + Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult)); + + // We can't run a published standalone app, but let's just make sure it publishes fine + var publishResult = await project.RunDotNetPublishAsync(); + Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult)); + + var buildResult = await project.RunDotNetBuildAsync(); + Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", project, buildResult)); + + await BuildAndRunTest(project.ProjectName, project); + } + + [Fact] + public async Task BlazorWasmHostedTemplate_Works() + { + var project = await ProjectFactory.GetOrCreateProject("blazorhosted", Output); + + var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "--hosted" }); + Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult)); + + var serverProject = GetSubProject(project, "Server", $"{project.ProjectName}.Server"); + + var publishResult = await serverProject.RunDotNetPublishAsync(); + Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", serverProject, publishResult)); + + var buildResult = await serverProject.RunDotNetBuildAsync(); + Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", serverProject, buildResult)); + + await BuildAndRunTest(project.ProjectName, serverProject); + + using var aspNetProcess = serverProject.StartPublishedProjectAsync(); + + Assert.False( + aspNetProcess.Process.HasExited, + ErrorMessages.GetFailedProcessMessageOrEmpty("Run published project", serverProject, aspNetProcess.Process)); + + await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); + if (BrowserFixture.IsHostAutomationSupported()) + { + aspNetProcess.VisitInBrowser(Browser); + TestBasicNavigation(project.ProjectName, serverProject); + } + else + { + BrowserFixture.EnforceSupportedConfigurations(); + } + } + + protected async Task BuildAndRunTest(string appName, Project project) + { + using var aspNetProcess = project.StartBuiltProjectAsync(); + + Assert.False( + aspNetProcess.Process.HasExited, + ErrorMessages.GetFailedProcessMessageOrEmpty("Run built project", project, aspNetProcess.Process)); + + await aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); + if (BrowserFixture.IsHostAutomationSupported()) + { + aspNetProcess.VisitInBrowser(Browser); + TestBasicNavigation(appName, project); + } + else + { + BrowserFixture.EnforceSupportedConfigurations(); + } + } + + private void TestBasicNavigation(string appName, Project project) + { + // Give components.server enough time to load so that it can replace + // the prerendered content before we start making assertions. + Thread.Sleep(5000); + Browser.Exists(By.TagName("ul")); + + // element gets project ID injected into it during template execution + Browser.Equal(appName.Trim(), () => Browser.Title.Trim()); + + // Initially displays the home page + Browser.Equal("Hello, world!", () => Browser.FindElement(By.TagName("h1")).Text); + + // Can navigate to the counter page + Browser.FindElement(By.PartialLinkText("Counter")).Click(); + Browser.Contains("counter", () => Browser.Url); + Browser.Equal("Counter", () => Browser.FindElement(By.TagName("h1")).Text); + + // Clicking the counter button works + Browser.Equal("Current count: 0", () => Browser.FindElement(By.CssSelector("h1 + p")).Text); + Browser.FindElement(By.CssSelector("p+button")).Click(); + Browser.Equal("Current count: 1", () => Browser.FindElement(By.CssSelector("h1 + p")).Text); + + // Can navigate to the 'fetch data' page + Browser.FindElement(By.PartialLinkText("Fetch data")).Click(); + Browser.Contains("fetchdata", () => Browser.Url); + Browser.Equal("Weather forecast", () => Browser.FindElement(By.TagName("h1")).Text); + + // Asynchronously loads and displays the table of weather forecasts + Browser.Exists(By.CssSelector("table>tbody>tr")); + Browser.Equal(5, () => Browser.FindElements(By.CssSelector("p+table>tbody>tr")).Count); + } + + private Project GetSubProject(Project project, string projectDirectory, string projectName) + { + var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); + if (!Directory.Exists(subProjectDirectory)) + { + throw new DirectoryNotFoundException($"Directory {subProjectDirectory} was not found."); + } + + var subProject = new Project + { + DotNetNewLock = project.DotNetNewLock, + NodeLock = project.NodeLock, + Output = project.Output, + DiagnosticsMessageSink = project.DiagnosticsMessageSink, + ProjectName = projectName, + TemplateOutputDir = subProjectDirectory, + }; + + return subProject; + } + } +} diff --git a/src/ProjectTemplates/test/Helpers/Project.cs b/src/ProjectTemplates/test/Helpers/Project.cs index 7b4ed718ed..cbb97d606f 100644 --- a/src/ProjectTemplates/test/Helpers/Project.cs +++ b/src/ProjectTemplates/test/Helpers/Project.cs @@ -110,7 +110,7 @@ namespace Templates.Test.Helpers } } - internal async Task<ProcessEx> RunDotNetPublishAsync(bool takeNodeLock = false, IDictionary<string,string> packageOptions = null) + internal async Task<ProcessEx> RunDotNetPublishAsync(bool takeNodeLock = false, IDictionary<string,string> packageOptions = null, string additionalArgs = null) { Output.WriteLine("Publishing ASP.NET application..."); @@ -121,7 +121,7 @@ namespace Templates.Test.Helpers await effectiveLock.WaitAsync(); try { - var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), $"publish -c Release /bl", packageOptions); + var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), $"publish -c Release /bl /nr:false {additionalArgs}", packageOptions); await result.Exited; CaptureBinLogOnFailure(result); return result; @@ -132,7 +132,7 @@ namespace Templates.Test.Helpers } } - internal async Task<ProcessEx> RunDotNetBuildAsync(bool takeNodeLock = false, IDictionary<string,string> packageOptions = null) + internal async Task<ProcessEx> RunDotNetBuildAsync(bool takeNodeLock = false, IDictionary<string,string> packageOptions = null, string additionalArgs = null) { Output.WriteLine("Building ASP.NET application..."); @@ -143,7 +143,7 @@ namespace Templates.Test.Helpers await effectiveLock.WaitAsync(); try { - var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), "build -c Debug /bl", packageOptions); + var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), $"build -c Debug /bl /nr:false {additionalArgs}", packageOptions); await result.Exited; CaptureBinLogOnFailure(result); return result; @@ -211,7 +211,7 @@ namespace Templates.Test.Helpers }; var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); - return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, hasListeningUri: hasListeningUri); + return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, published: false, hasListeningUri: hasListeningUri); } internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true) diff --git a/src/ProjectTemplates/test/Helpers/TemplatePackageInstaller.cs b/src/ProjectTemplates/test/Helpers/TemplatePackageInstaller.cs index f9de81d768..30983a55fc 100644 --- a/src/ProjectTemplates/test/Helpers/TemplatePackageInstaller.cs +++ b/src/ProjectTemplates/test/Helpers/TemplatePackageInstaller.cs @@ -38,7 +38,8 @@ namespace Templates.Test.Helpers "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.1", "Microsoft.DotNet.Web.Spa.ProjectTemplates.5.0", - "Microsoft.DotNet.Web.Spa.ProjectTemplates" + "Microsoft.DotNet.Web.Spa.ProjectTemplates", + "Microsoft.AspNetCore.Blazor.Templates", }; public static string CustomHivePath { get; } = typeof(TemplatePackageInstaller) @@ -88,7 +89,7 @@ namespace Templates.Test.Helpers .Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) .ToArray(); - Assert.Equal(4, builtPackages.Length); + Assert.Equal(5, builtPackages.Length); /* * The templates are indexed by path, for example: diff --git a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj index f755b3b8f2..cea69d2d16 100644 --- a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj +++ b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj @@ -46,6 +46,7 @@ <ProjectReference Include="../Web.ItemTemplates/Microsoft.DotNet.Web.ItemTemplates.csproj" ReferenceOutputAssembly="false" /> <ProjectReference Include="../Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj" ReferenceOutputAssembly="false" /> <ProjectReference Include="../Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj" ReferenceOutputAssembly="false" /> + <ProjectReference Include="../BlazorWasm.ProjectTemplates/Microsoft.AspNetCore.Blazor.Templates.csproj" ReferenceOutputAssembly="false" /> </ItemGroup> <ItemGroup>