File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ @using Microsoft .AspNetCore .Components .Routing
2+ @using SimpleStaticBlazor
3+
4+ <Router AppAssembly =" @typeof(Program).Assembly" >
5+ <Found Context =" routeData" >
6+ <RouteView RouteData =" @routeData" />
7+ </Found >
8+ <NotFound >
9+ <p >Sorry, there's nothing at this address.</p >
10+ </NotFound >
11+ </Router >
Original file line number Diff line number Diff line change 1+ @inherits LayoutComponentBase
2+ @page " /"
3+
4+ <div class =" main" >
5+ <div class =" content px-4" >
6+ <h1 >Hello, world!</h1 >
7+ </div >
8+ </div >
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . Blazor . Hosting ;
2+
3+ namespace SimpleStaticBlazor
4+ {
5+ public class Program
6+ {
7+ public static void Main ( string [ ] args )
8+ {
9+ CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
10+ }
11+
12+ public static IWebAssemblyHostBuilder CreateHostBuilder ( string [ ] args ) =>
13+ BlazorWebAssemblyHost . CreateDefaultBuilder ( )
14+ . UseBlazorStartup < Startup > ( ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change 1- # SimpleStaticBlazor
1+ # SimpleStaticBlazor
2+ ## Publish
3+
4+ ` dotnet publish -c release `
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk.Web" >
2+
3+ <PropertyGroup >
4+ <TargetFramework >netstandard2.0</TargetFramework >
5+ <OutputType >Exe</OutputType >
6+ <LangVersion >7.3</LangVersion >
7+ <RazorLangVersion >3.0</RazorLangVersion >
8+ </PropertyGroup >
9+
10+ <ItemGroup >
11+ <PackageReference Include =" Microsoft.AspNetCore.Blazor" Version =" 3.0.0-preview9.19465.2" />
12+ <PackageReference Include =" Microsoft.AspNetCore.Blazor.Build" Version =" 3.0.0-preview9.19465.2" PrivateAssets =" all" />
13+ </ItemGroup >
14+
15+ </Project >
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . Components . Builder ;
2+ using Microsoft . Extensions . DependencyInjection ;
3+
4+ namespace SimpleStaticBlazor
5+ {
6+ public class Startup
7+ {
8+ public void ConfigureServices ( IServiceCollection services )
9+ {
10+ }
11+
12+ public void Configure ( IComponentsApplicationBuilder app )
13+ {
14+ app . AddComponent < App > ( "app" ) ;
15+ }
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < meta name ="viewport " content ="width=device-width " />
6+ < title > simple-blazor</ title >
7+ < base href ="/ " />
8+ </ head >
9+ < body >
10+ < app > Loading...</ app >
11+
12+ < script src ="_framework/blazor.webassembly.js "> </ script >
13+ </ body >
14+ </ html >
You can’t perform that action at this time.
0 commit comments