diff --git a/src/Components/Components/src/Routing/Router.cs b/src/Components/Components/src/Routing/Router.cs index 8c3d2b40ea08..81aeaa86d9f2 100644 --- a/src/Components/Components/src/Routing/Router.cs +++ b/src/Components/Components/src/Routing/Router.cs @@ -7,6 +7,7 @@ using System.Reflection.Metadata; using System.Runtime.ExceptionServices; using Microsoft.AspNetCore.Components.HotReload; +using Microsoft.AspNetCore.Components.Rendering; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Components.Routing; @@ -64,7 +65,6 @@ static readonly IReadOnlyDictionary _emptyParametersDictionary /// Gets or sets the content to display when no match is found for the requested route. /// [Parameter] - [EditorRequired] public RenderFragment NotFound { get; set; } /// @@ -126,13 +126,6 @@ public async Task SetParametersAsync(ParameterView parameters) throw new InvalidOperationException($"The {nameof(Router)} component requires a value for the parameter {nameof(Found)}."); } - // NotFound content is mandatory, because even though we could display a default message like "Not found", - // it has to be specified explicitly so that it can also be wrapped in a specific layout - if (NotFound == null) - { - throw new InvalidOperationException($"The {nameof(Router)} component requires a value for the parameter {nameof(NotFound)}."); - } - if (!_onNavigateCalled) { _onNavigateCalled = true; @@ -233,7 +226,7 @@ internal virtual void Refresh(bool isNavigationIntercepted) // We did not find a Component that matches the route. // Only show the NotFound content if the application developer programatically got us here i.e we did not // intercept the navigation. In all other cases, force a browser navigation since this could be non-Blazor content. - _renderHandle.Render(NotFound); + _renderHandle.Render(NotFound ?? DefaultNotFoundContent); } else { @@ -243,6 +236,17 @@ internal virtual void Refresh(bool isNavigationIntercepted) } } + private static void DefaultNotFoundContent(RenderTreeBuilder builder) + { + // This output can't use any layout (none is specified), and it can't use any web-specific concepts + // such as

, and we can't localize the output. However none of that matters because + // in all cases we expect either: + // 1. The app to be hosted with MapRazorPages, and then it will never use any NotFound content + // 2. Or, the app to supply its own NotFound content + // ... so this is just a fallback for badly-set-up apps. + builder.AddContent(0, "Not found"); + } + internal async ValueTask RunOnNavigateAsync(string path, bool isNavigationIntercepted) { // Cancel the CTS instead of disposing it, since disposing does not diff --git a/src/Components/Components/test/Routing/RouterTest.cs b/src/Components/Components/test/Routing/RouterTest.cs index b413b286f2a4..2e8a05bd9145 100644 --- a/src/Components/Components/test/Routing/RouterTest.cs +++ b/src/Components/Components/test/Routing/RouterTest.cs @@ -182,7 +182,7 @@ public async Task UsesCurrentRouteMatchingIfSpecified() // Arrange // Current routing prefers exactly-matched patterns over {*someWildcard}, no matter // how many segments are in the exact match - _navigationManager.NotifyLocationChanged("https://www.example.com/subdir/a/b", false); + _navigationManager.NotifyLocationChanged("https://www.example.com/subdir/a/b/c", false); var parameters = new Dictionary { { nameof(Router.AppAssembly), typeof(RouterTest).Assembly }, @@ -224,6 +224,47 @@ await _renderer.Dispatcher.InvokeAsync(() => Assert.Equal(1, refreshCalled); } + [Fact] + public async Task UsesNotFoundContentIfSpecified() + { + // Arrange + _navigationManager.NotifyLocationChanged("https://www.example.com/subdir/nonexistent", false); + var parameters = new Dictionary + { + { nameof(Router.AppAssembly), typeof(RouterTest).Assembly }, + { nameof(Router.NotFound), (RenderFragment)(builder => builder.AddContent(0, "Custom content")) }, + }; + + // Act + await _renderer.Dispatcher.InvokeAsync(() => + _router.SetParametersAsync(ParameterView.FromDictionary(parameters))); + + // Assert + var renderedFrame = _renderer.Batches.First().ReferenceFrames.First(); + Assert.Equal(RenderTreeFrameType.Text, renderedFrame.FrameType); + Assert.Equal("Custom content", renderedFrame.TextContent); + } + + [Fact] + public async Task UsesDefaultNotFoundContentIfNotSpecified() + { + // Arrange + _navigationManager.NotifyLocationChanged("https://www.example.com/subdir/nonexistent", false); + var parameters = new Dictionary + { + { nameof(Router.AppAssembly), typeof(RouterTest).Assembly } + }; + + // Act + await _renderer.Dispatcher.InvokeAsync(() => + _router.SetParametersAsync(ParameterView.FromDictionary(parameters))); + + // Assert + var renderedFrame = _renderer.Batches.First().ReferenceFrames.First(); + Assert.Equal(RenderTreeFrameType.Text, renderedFrame.FrameType); + Assert.Equal("Not found", renderedFrame.TextContent); + } + internal class TestNavigationManager : NavigationManager { public TestNavigationManager() => @@ -260,9 +301,9 @@ public class FebComponent : ComponentBase { } [Route("jan")] public class JanComponent : ComponentBase { } - [Route("{*matchAnything}")] + [Route("a/{*matchAnything}")] public class MatchAnythingComponent : ComponentBase { } - [Route("a/b")] + [Route("a/b/c")] public class MultiSegmentRouteComponent : ComponentBase { } } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.Client.csproj.in b/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.Client.csproj.in new file mode 100644 index 000000000000..027eeefed22b --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.Client.csproj.in @@ -0,0 +1,17 @@ + + + + ${DefaultNetCoreTargetFramework} + enable + enable + true + Default + BlazorWeb-CSharp.Client + `$(AssemblyName.Replace(' ', '_')) + + + + + + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.csproj.in b/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.csproj.in new file mode 100644 index 000000000000..31be9a845da9 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.csproj.in @@ -0,0 +1,19 @@ + + + + ${DefaultNetCoreTargetFramework} + enable + enable + True + BlazorWeb-CSharp + `$(AssemblyName.Replace(' ', '_')) + + + + + + + + + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/Components-CSharp.csproj.in b/src/ProjectTemplates/Web.ProjectTemplates/Components-CSharp.csproj.in deleted file mode 100644 index b0ea42d2056e..000000000000 --- a/src/ProjectTemplates/Web.ProjectTemplates/Components-CSharp.csproj.in +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ${DefaultNetCoreTargetFramework};${DefaultNetCoreTargetFramework}-browser - - ${DefaultNetCoreTargetFramework} - - enable - enable - True - ComponentsWebAssembly-CSharp.Server - `$(AssemblyName.Replace(' ', '_')) - - service-worker-assets.js - - - - - - - - - - - - - - - - - - - - diff --git a/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj b/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj index 7447dbd4f1bf..472d039a9117 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj +++ b/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj @@ -62,7 +62,8 @@ - + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/dotnetcli.host.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/dotnetcli.host.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/dotnetcli.host.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/dotnetcli.host.json index 5e258978721e..f421cba00a17 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/dotnetcli.host.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/dotnetcli.host.json @@ -5,15 +5,16 @@ "longName": "no-restore", "shortName": "" }, - "PWA": { - "longName": "pwa", - "isHidden": true - }, "UseServer": { "longName": "use-server" }, "UseWebAssembly": { - "longName": "use-wasm", + "longName": "use-wasm" + }, + "Empty": { + "longName": "empty" + }, + "IncludeSampleContent": { "isHidden": true }, "Framework": { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/icon.png b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/icon.png similarity index 100% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/icon.png rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/icon.png diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/ide.host.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/ide.host.json similarity index 75% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/ide.host.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/ide.host.json index cbf237c42241..d6c7811ef21e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/ide.host.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/ide.host.json @@ -11,16 +11,17 @@ }, { "id": "UseWebAssembly", - "isVisible": false, + "isVisible": true, "persistenceScope": "templateGroup" }, { - "id": "PWA", - "isVisible": false, - "persistenceScope": "templateGroup" + "id": "UseProgramMain", + "isVisible": true, + "persistenceScope": "shared", + "persistenceScopeName": "Microsoft" }, { - "id": "UseProgramMain", + "id": "IncludeSampleContent", "isVisible": true, "persistenceScope": "shared", "persistenceScopeName": "Microsoft" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.cs.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.cs.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.cs.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.cs.json index ab047d1e60b6..96d435f5128d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.cs.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.cs.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Pokud je zadáno, nakonfiguruje projekt tak, aby vykreslovat komponenty interaktivně v prohlížeči pomocí WebAssembly.", "symbols/UseServer/displayName": "_Použít interaktivní serverové komponenty", "symbols/UseServer/description": "Pokud je zadáno, nakonfiguruje projekt tak, aby vykresloval komponenty interaktivně na serveru.", - "symbols/PWA/displayName": "_Progresivní webová aplikace", - "symbols/PWA/description": "Pokud je tato možnost zadaná, vytvoří progresivní webovou aplikaci (PWA), která podporuje instalaci a offline použití.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Určuje, jestli se má protokol HTTPS vypnout. Tato možnost platí jenom v případě, že se pro --auth nepoužívají Individual, IndividualB2C, SingleOrg ani MultiOrg.", "symbols/UseProgramMain/displayName": "Nepoužívat _příkazy nejvyšší úrovně", "symbols/UseProgramMain/description": "Určuje, jestli se má místo příkazů nejvyšší úrovně generovat explicitní třída Program a metoda Main.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.de.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.de.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.de.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.de.json index fbc11154db98..ad35a2057850 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.de.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.de.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Bei Angabe dieser Option wird das Projekt so konfiguriert, dass Komponenten interaktiv mithilfe von WebAssembly im Browser gerendert werden.", "symbols/UseServer/displayName": "_Interaktive Serverkomponenten verwenden", "symbols/UseServer/description": "Bei Angabe dieser Option wird das Projekt so konfiguriert, dass Komponenten interaktiv auf dem Server gerendert werden.", - "symbols/PWA/displayName": "_Progressive Webanwendung", - "symbols/PWA/description": "Wenn angegeben, wird eine Progressive Web Application (PWA) erstellt, die die Installation und Offlineverwendung unterstützt.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Ob HTTPS deaktiviert werden soll. Diese Option gilt nur, wenn Individual, IndividualB2C, SingleOrg oder MultiOrg nicht für --auth verwendet werden.", "symbols/UseProgramMain/displayName": "Keine Anweisungen_der obersten Ebene verwenden", "symbols/UseProgramMain/description": "Gibt an, ob anstelle von Anweisungen der obersten Ebene eine explizite Programmklasse und eine Main-Methode generiert werden soll.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.en.json similarity index 75% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.en.json index 6c2ae63a0128..728e68ee72da 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.en.json @@ -11,11 +11,12 @@ "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", "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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).", "symbols/UseWebAssembly/displayName": "_Use interactive WebAssembly components", - "symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively in the browser using WebAssembly.", + "symbols/UseWebAssembly/description": "Configures whether to support rendering components interactively in the browser using WebAssembly. The default value is false.", "symbols/UseServer/displayName": "_Use interactive server components", - "symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.", - "symbols/PWA/displayName": "_Progressive Web Application", - "symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.", + "symbols/UseServer/description": "Configures whether to support rendering components interactively on the server via a SignalR WebSocket connection. The default value is true.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", "symbols/UseProgramMain/displayName": "Do not use _top-level statements", "symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.es.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.es.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.es.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.es.json index 03ead58267d0..67e2a4ebf6e2 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.es.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.es.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Si se especifica, esta opción configura el proyecto para representar los componentes de forma interactiva en el explorador mediante WebAssembly.", "symbols/UseServer/displayName": "_Use componentes de servidor interactivos", "symbols/UseServer/description": "Si se especifica, esta opción configura el proyecto para representar los componentes de forma interactiva en el servidor.", - "symbols/PWA/displayName": "_Aplicación web progresiva", - "symbols/PWA/description": "Si se especifica, produce una aplicación web progresiva (PWA) compatible con la instalación y el uso sin conexión.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Si se va a desactivar HTTPS. Esta opción solo se aplica si Individual, IndividualB2C, SingleOrg o MultiOrg no se usan para --auth.", "symbols/UseProgramMain/displayName": "No usar instrucciones de _nivel superior", "symbols/UseProgramMain/description": "Indica si se debe generar una clase Program explícita y un método Main en lugar de instrucciones de nivel superior.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.fr.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.fr.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.fr.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.fr.json index 8cfac461a30b..db910e507719 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.fr.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.fr.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "S’il est spécifié, configure le projet pour afficher les composants de manière interactive dans le navigateur à l’aide de WebAssembly.", "symbols/UseServer/displayName": "_Utiliser les composants serveur interactifs", "symbols/UseServer/description": "Si ce paramètre est spécifié, configure le projet pour afficher les composants de manière interactive sur le serveur.", - "symbols/PWA/displayName": "_Application web progressive", - "symbols/PWA/description": "Si ce paramètre est spécifié, produit une application web progressive (PWA) qui prend en charge l’installation et l’utilisation hors connexion.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Indique s’il faut désactiver HTTPS. Cette option s’applique uniquement si Individual, IndividualB2C, SingleOrg ou MultiOrg ne sont pas utilisés pour --auth.", "symbols/UseProgramMain/displayName": "N’utilisez pas _d’instructions de niveau supérieur.", "symbols/UseProgramMain/description": "Indique s’il faut générer une classe Programme explicite et une méthode Main au lieu d’instructions de niveau supérieur.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.it.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.it.json similarity index 88% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.it.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.it.json index bfcc9f7c04ce..5f102a9e4cf6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.it.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.it.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Se specificato, configura il progetto per il rendering interattivo dei componenti nel browser tramite WebAssembly.", "symbols/UseServer/displayName": "_Usa componenti server interattivi", "symbols/UseServer/description": "Se specificato, configura il progetto per il rendering interattivo dei componenti nel server.", - "symbols/PWA/displayName": "Applicazione Web _Progressive", - "symbols/PWA/description": "Se specificato, produce un'applicazione Web progressiva (PWA) che supporta l'installazione e l'uso offline.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Indica se disattivare HTTPS. Questa opzione si applica solo se Individual, IndividualB2C, SingleOrg o MultiOrg non vengono usati per --auth.", "symbols/UseProgramMain/displayName": "Non usare_istruzioni di primo livello", "symbols/UseProgramMain/description": "Indica se generare una classe Program esplicita e un metodo Main anziché istruzioni di primo livello.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ja.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ja.json similarity index 90% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ja.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ja.json index 1d8a08714cde..a3ff3e759d52 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ja.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ja.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "指定した場合、WebAssembly を使用してブラウザーでコンポーネントを対話的にレンダリングするようにプロジェクトを構成します。", "symbols/UseServer/displayName": "_対話型サーバー コンポーネントを使用する", "symbols/UseServer/description": "指定した場合、サーバー上でコンポーネントを対話的にレンダリングするようにプロジェクトを構成します。", - "symbols/PWA/displayName": "プログレッシブ Web アプリケーション(_P)", - "symbols/PWA/description": "指定した場合、インストールとオフラインでの使用をサポートするプログレッシブ Web アプリケーション (PWA) が生成されます。", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "HTTPS をオフにするかどうか。このオプションは、Individual、IndividualB2C、SingleOrg、または MultiOrg が --auth に使用されていない場合にのみ適用されます。", "symbols/UseProgramMain/displayName": "最上位レベルのステートメントを使用しない(_T)", "symbols/UseProgramMain/description": "最上位レベルのステートメントではなく、明示的な Program クラスと Main メソッドを生成するかどうか。", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ko.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ko.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ko.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ko.json index 30a7c6f0ab41..629e0475e2a4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ko.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ko.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "지정할 경우 WebAssembly를 사용하여 브라우저에서 대화형으로 구성 요소를 렌더링하도록 프로젝트를 구성합니다.", "symbols/UseServer/displayName": "_대화형 서버 구성 요소 사용", "symbols/UseServer/description": "지정되는 경우 서버에서 대화형으로 구성 요소를 렌더링하도록 프로젝트를 구성합니다.", - "symbols/PWA/displayName": "프로그레시브 웹 애플리케이션(_P)", - "symbols/PWA/description": "지정된 경우 설치 및 오프라인 사용을 지원하는 PWA(프로그레시브 웹 응용 프로그램)를 생성합니다.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "HTTPS를 끌지 여부입니다. 이 옵션은 Individual, IndividualB2C, SingleOrg 또는 MultiOrg가 --auth에 사용되지 않는 경우에만 적용됩니다.", "symbols/UseProgramMain/displayName": "최상위 문 사용 안 함(_T)", "symbols/UseProgramMain/description": "최상위 문 대신 명시적 Program 클래스 및 Main 메서드를 생성할지 여부입니다.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pl.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pl.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pl.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pl.json index 7901977a78c8..75b18370a6be 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pl.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pl.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Jeśli jest określony, konfiguruje projekt w celu interaktywnego renderowania składników w przeglądarce przy użyciu zestawu WebAssembly.", "symbols/UseServer/displayName": "_Używanie interakcyjnych składników serwera", "symbols/UseServer/description": "Jeśli określono, konfiguruje projekt do renderowania składników w sposób interakcyjny na serwerze.", - "symbols/PWA/displayName": "_Progresywna aplikacja internetowa", - "symbols/PWA/description": "Jeśli zostanie określony, tworzy progresywną aplikację internetową (PWA) obsługującą instalację i używanie w trybie offline.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Określa, czy wyłączyć protokół HTTPS. Ta opcja ma zastosowanie tylko wtedy, gdy dla uwierzytelniania --auth nie są używane elementy Individual, IndividualB2C, SingleOrg lub MultiOrg.", "symbols/UseProgramMain/displayName": "Nie używaj ins_trukcji najwyższego poziomu", "symbols/UseProgramMain/description": "Określa, czy wygenerować jawną klasę Program i metodę Main zamiast instrukcji najwyższego poziomu.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pt-BR.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pt-BR.json similarity index 88% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pt-BR.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pt-BR.json index e3aee1921693..9f9a99ebd3e0 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.pt-BR.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Se especificado, configura o projeto para renderizar componentes interativamente no navegador usando WebAssembly.", "symbols/UseServer/displayName": "_Use componentes de servidor interativos", "symbols/UseServer/description": "Se especificado, configura o projeto para renderizar componentes interativamente no servidor.", - "symbols/PWA/displayName": "_Aplicativo da Web Progressivo", - "symbols/PWA/description": "Se especificado, produz um Progressive Web Application (PWA) com suporte para instalação e uso offline.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Se o HTTPS deve ser desativado. Essa opção se aplica somente se Individual, IndividualB2C, SingleOrg ou MultiOrg não forem usados para --auth.", "symbols/UseProgramMain/displayName": "Não use ins_truções de nível superior", "symbols/UseProgramMain/description": "Se deve gerar uma classe de Programa explícita e um método principal em vez de instruções de nível superior.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ru.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ru.json similarity index 91% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ru.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ru.json index 488aa72d591a..63f6ecb4a6c2 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.ru.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.ru.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Если указано, настраивает проект для интерактивного отображения компонентов в браузере с помощью WebAssembly.", "symbols/UseServer/displayName": "_Использовать интерактивные компоненты сервера", "symbols/UseServer/description": "Если указано, настраивает проект для интерактивного отображения компонентов на сервере.", - "symbols/PWA/displayName": "_Прогрессивное веб-приложение", - "symbols/PWA/description": "Если указывается, используется для создания прогрессивного веб-приложения (PWA), поддерживающего установку и автономное использование.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "Следует ли отключить HTTPS. Этот параметр применяется, только если для --auth не используются Individual, IndividualB2C, SingleOrg или MultiOrg.", "symbols/UseProgramMain/displayName": "Не использовать _операторы верхнего уровня", "symbols/UseProgramMain/description": "Следует ли создавать явный класс Program и метод Main вместо операторов верхнего уровня.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.tr.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.tr.json similarity index 89% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.tr.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.tr.json index 059976ffd9db..b34b7df76d41 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.tr.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.tr.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "Belirtilmişse, projeyi Webassembly kullanarak bileşenleri tarayıcıda etkileşimli olarak işleyecek şekilde yapılandırır.", "symbols/UseServer/displayName": "_Etkileşimli sunucu bileşenlerini kullanın", "symbols/UseServer/description": "Belirtilmişse, projeyi bileşenleri sunucuda etkileşimli olarak işleyecek şekilde yapılandırır.", - "symbols/PWA/displayName": "_Aşamalı Web Uygulaması", - "symbols/PWA/description": "Belirtilmişse, yükleme ve çevrimdışı kullanımı destekleyen bir Aşamalı Web Uygulaması (PWA) oluşturur.", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "HTTPS'nin kapatılıp kapatılmayacağı. Bu seçenek yalnızca Bireysel, IndividualB2C, SingleOrg veya MultiOrg -- auth için kullanılmazsa geçerlidir.", "symbols/UseProgramMain/displayName": "_Üst düzey deyimler kullanmayın", "symbols/UseProgramMain/description": "Üst düzey deyimler yerine açık bir Program sınıfı ve Ana yöntem oluşturup oluşturulmayacağını belirtir.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hans.json similarity index 86% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hans.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hans.json index 15950cf1a0b2..a609cff321a5 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hans.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "如果指定,则将项目配置为使用 WebAssembly 在浏览器上以交互方式呈现组件。", "symbols/UseServer/displayName": "使用交互式服务器组件(_U)", "symbols/UseServer/description": "如果指定,则将项目配置为在服务器上以交互方式呈现组件。", - "symbols/PWA/displayName": "渐进式 Web 应用程序(_P)", - "symbols/PWA/description": "如果指定,则生成支持安装和脱机使用的渐进式 Web 应用程序(PWA)。", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "是否禁用 HTTPS。仅当 Individual、IndividualB2C、SingleOrg 或 MultiOrg 不用于 --auth 时,此选项才适用。", "symbols/UseProgramMain/displayName": "不使用顶级语句(_T)", "symbols/UseProgramMain/description": "是否生成显式程序类和主方法,而不是顶级语句。", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hant.json similarity index 87% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hant.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hant.json index 04f3177195c7..3c9c5d8ad1a4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.zh-Hant.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -14,8 +14,9 @@ "symbols/UseWebAssembly/description": "若指定,會將專案設定為使用 WebAssembly 在瀏覽器中以互動方式轉譯元件。", "symbols/UseServer/displayName": "使用互動式伺服器元件(_U)", "symbols/UseServer/description": "若指定,會將專案設定為在伺服器上以互動方式轉譯元件。", - "symbols/PWA/displayName": "漸進式 Web 應用程式(_P)", - "symbols/PWA/description": "若指定,會產生漸進式 Web 應用程式 (PWA) 支援安裝與離線使用。", + "symbols/IncludeSampleContent/displayName": "_Include sample pages", + "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns.", + "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/NoHttps/description": "是否要關閉 HTTPS。只有當 Individual、IndividualB2C、SingleOrg 或 MultiOrg 未用於 --auth 時,才適用此選項。", "symbols/UseProgramMain/displayName": "不要使用最上層陳述式(_T)", "symbols/UseProgramMain/description": "是否要產生明確的 Program 類別和 Main 方法,而非最上層語句。", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json similarity index 71% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/template.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json index 0a9570f4877a..b01a54d41b72 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json @@ -4,8 +4,7 @@ "classifications": [ "Web", "Blazor", - "WebAssembly", - "PWA" + "WebAssembly" ], "name": "Blazor Web App", "defaultName": "BlazorApp", @@ -15,19 +14,31 @@ "guids": [ "4C26868E-5E7C-458D-82E3-040509D0C71F", "5990939C-7E7B-4CFA-86FF-44CA5756498A", - "650B3CE7-2E93-4CC4-9F46-466686815EAA", - "0AFFA7FD-4E37-4636-AB91-3753E746DB98" + "650B3CE7-2E93-4CC4-9F46-466686815EAA" ], "identity": "Microsoft.Web.Blazor.CSharp.8.0", "thirdPartyNotices": "https://aka.ms/aspnetcore/8.0-third-party-notices", "preferNameDirectory": true, "primaryOutputs": [ { - "path": "Components-CSharp.csproj" + "condition": "(UseWebAssembly && (HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\"))", + "path": "BlazorWeb-CSharp.sln" + }, + { + "condition": "(UseWebAssembly && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "BlazorWeb-CSharp/BlazorWeb-CSharp.csproj" + }, + { + "condition": "(!UseWebAssembly)", + "path": "BlazorWeb-CSharp.csproj" + }, + { + "condition": "(UseWebAssembly && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "BlazorWeb-CSharp.Client/BlazorWeb-CSharp.Client.csproj" } ], "shortName": "blazor", - "sourceName": "Components-CSharp", + "sourceName": "BlazorWeb-CSharp", "sources": [ { "source": "./", @@ -36,68 +47,58 @@ ".template.config/**" ], "copyOnly": [ - "**/wwwroot/css/**" + "**/wwwroot/bootstrap/**" ], "modifiers": [ - { - "condition": "(!PWA)", - "exclude": [ - "wwwroot/service-worker*.js", - "wwwroot/manifest.webmanifest", - "wwwroot/icon-512.png" - ] - }, { "condition": "(!UseWebAssembly)", "exclude": [ - "Program.Browser.Main.cs", - "Program.Browser.cs", - "wwwroot/appsettings.Development.json", - "wwwroot/appsettings.json" + "BlazorWeb-CSharp/wwwroot/appsettings.Development.json", + "BlazorWeb-CSharp/wwwroot/appsettings.json", + "BlazorWeb-CSharp.Client/**", + "*.sln" ], "rename": { - "Program.Server.Main.cs": "Program.cs", - "Program.Server.cs": "Program.cs" + "BlazorWeb-CSharp/": "./" } }, { "condition": "(!UseProgramMain)", "exclude": [ - "Program.Server.Main.cs", - "Program.Browser.Main.cs" + "BlazorWeb-CSharp/Program.Main.cs" ] }, { - "condition": "(UseProgramMain && !UseWebAssembly)", + "condition": "(UseProgramMain)", "exclude": [ - "Program.Server.cs", - "Program.Browser.cs" + "BlazorWeb-CSharp/Program.cs" ], "rename": { - "Program.Server.Main.cs": "Program.cs" + "Program.Main.cs": "Program.cs" } }, { - "condition": "(!UseServer && !UseWebAssembly)", + "condition": "!(UseServer || UseWebAssembly)", "exclude": [ - "Pages/Counter.razor" + "BlazorWeb-CSharp/Components/Pages/Counter.razor" ] }, { - "condition": "(UseProgramMain && UseWebAssembly)", + "condition": "(ExcludeLaunchSettings)", "exclude": [ - "Program.Server.cs", - "Program.Browser.cs" - ], - "rename": { - "Program.Server.Main.cs": "Program.Server.cs", - "Program.Browser.Main.cs": "Program.Browser.cs" - } + "BlazorWeb-CSharp/Properties/launchSettings.json" + ] }, { - "condition": "(ExcludeLaunchSettings)", + "condition": "(!SampleContent)", "exclude": [ - "Properties/launchSettings.json" + "BlazorWeb-CSharp/Components/Pages/Counter.*", + "BlazorWeb-CSharp/Components/Pages/Weather.*", + "BlazorWeb-CSharp/Components/Layout/NavMenu.*", + "BlazorWeb-CSharp/wwwroot/bootstrap/**", + "BlazorWeb-CSharp/wwwroot/favicon.*", + "BlazorWeb-CSharp.Client/Pages/**", + "BlazorWeb-CSharp.Client/wwwroot/**" ] } ] @@ -222,21 +223,31 @@ "datatype": "bool", "defaultValue": "false", "displayName": "_Use interactive WebAssembly components", - "description": "If specified, configures the project to render components interactively in the browser using WebAssembly." + "description": "Configures whether to support rendering components interactively in the browser using WebAssembly. The default value is false." }, "UseServer": { "type": "parameter", "datatype": "bool", - "defaultValue": "false", + "defaultValue": "true", "displayName": "_Use interactive server components", - "description": "If specified, configures the project to render components interactively on the server." + "description": "Configures whether to support rendering components interactively on the server via a SignalR WebSocket connection. The default value is true." }, - "PWA": { + "IncludeSampleContent": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "true", + "displayName": "_Include sample pages", + "description": "Configures whether to add sample pages and styling to demonstrate basic usage patterns." + }, + "Empty": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "displayName": "_Progressive Web Application", - "description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use." + "description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns." + }, + "SampleContent": { + "type": "computed", + "value": "(((IncludeSampleContent && (HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\"))) || ((!Empty && (HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\"))))" }, "RequiresHttps": { "type": "computed", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Pages/Counter.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Pages/Counter.razor similarity index 65% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Pages/Counter.razor rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Pages/Counter.razor index 6c38e506c306..ae7b63e32c65 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Pages/Counter.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Pages/Counter.razor @@ -1,12 +1,7 @@ -@page "/counter" -@*#if (UseServer && !UseWebAssembly) --> -@attribute [RenderModeServer] -##endif*@ -@*#if (!UseServer && UseWebAssembly) --> -@attribute [RenderModeWebAssembly] -##endif*@ -@*#if (UseServer && UseWebAssembly) --> +@*#if (UseServer) --> @attribute [RenderModeAuto] +##else +@attribute [RenderModeWebAssembly] ##endif*@ Counter diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Program.Browser.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Program.cs similarity index 78% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Program.Browser.cs rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Program.cs index 143dd2823922..519269f21bb8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Program.Browser.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Program.cs @@ -1,4 +1,3 @@ -using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; var builder = WebAssemblyHostBuilder.CreateDefault(args); diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/_Imports.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/_Imports.razor similarity index 82% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/_Imports.razor rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/_Imports.razor index 3ff7db7775f0..5268e26fd6aa 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/_Imports.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/_Imports.razor @@ -5,5 +5,4 @@ @using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop -@using Components_CSharp -@using Components_CSharp.Shared +@using BlazorWeb_CSharp.Client diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/appsettings.Development.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/wwwroot/appsettings.Development.json similarity index 100% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/appsettings.Development.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/wwwroot/appsettings.Development.json diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/wwwroot/appsettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/wwwroot/appsettings.json similarity index 100% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/wwwroot/appsettings.json rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/wwwroot/appsettings.json diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.sln b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.sln new file mode 100644 index 000000000000..88a77b704be8 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.0.0 +MinimumVisualStudioVersion = 16.0.0.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWeb-CSharp", "BlazorWeb-CSharp\BlazorWeb-CSharp.csproj", "{650B3CE7-2E93-4CC4-9F46-466686815EAA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWeb-CSharp.Client", "BlazorWeb-CSharp.Client\BlazorWeb-CSharp.Client.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 diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/App.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/App.razor new file mode 100644 index 000000000000..d9d36a8fb2b9 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/App.razor @@ -0,0 +1,24 @@ + + + + + + + + @*#if (SampleContent) --> + + ##endif*@ + + + @*#if (SampleContent) --> + + ##endif*@ + + + + + + + + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor similarity index 59% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor index 7cd63fe1c017..b157cfb57efe 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor @@ -1,4 +1,5 @@ @inherits LayoutComponentBase +@*#if (SampleContent) -->

+##else + +@Body +##endif*@ +@*#if (UseServer || UseWebAssembly) --> + +
+ An unhandled error has occurred. + Reload + 🗙 +
+##endif*@ diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor.css b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor.css similarity index 77% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor.css rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor.css index c8654276b36d..7ff6c937d982 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/MainLayout.razor.css +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor.css @@ -1,3 +1,4 @@ +/*#if (SampleContent)*/ .page { position: relative; display: flex; @@ -79,3 +80,23 @@ main { padding-right: 1.5rem !important; } } + +/*#endif*/ +#blazor-error-ui { + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; +} + + #blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; + } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/NavMenu.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/NavMenu.razor similarity index 63% rename from src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/NavMenu.razor rename to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/NavMenu.razor index 399cd85ffd5a..cd2e389061f6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/Shared/NavMenu.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/NavMenu.razor @@ -1,13 +1,12 @@  -