├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE.txt ├── NET8 ├── BlazorInteractiveServer │ ├── BlazorInteractiveServer.csproj │ ├── Components │ │ ├── App.razor │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ └── MainLayout.razor.css │ │ ├── Pages │ │ │ ├── Error.razor │ │ │ └── Home.razor │ │ ├── Routes.razor │ │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ └── app.css ├── BlazorInteractiveWebAssembly │ ├── BlazorInteractiveWebAssembly.Client │ │ ├── BlazorInteractiveWebAssembly.Client.csproj │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ └── MainLayout.razor.css │ │ ├── Pages │ │ │ └── Home.razor │ │ ├── Program.cs │ │ ├── Routes.razor │ │ └── _Imports.razor │ └── BlazorInteractiveWebAssembly │ │ ├── BlazorInteractiveWebAssembly.csproj │ │ ├── Components │ │ ├── App.razor │ │ ├── Pages │ │ │ └── Error.razor │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ └── app.css └── BlazorSSRNoInteractivity │ ├── BlazorSSRNoInteractivity.csproj │ ├── Components │ ├── App.razor │ ├── Layout │ │ ├── MainLayout.razor │ │ └── MainLayout.razor.css │ ├── Pages │ │ ├── Error.razor │ │ └── Home.razor │ ├── Routes.razor │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ └── app.css ├── NET9 ├── BlazorInteractiveServer │ ├── BlazorInteractiveServer.csproj │ ├── Components │ │ ├── App.razor │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ └── MainLayout.razor.css │ │ ├── Pages │ │ │ ├── Error.razor │ │ │ └── Home.razor │ │ ├── Routes.razor │ │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ └── app.css ├── BlazorInteractiveWebAssembly │ ├── BlazorInteractiveWebAssembly.Client │ │ ├── BlazorInteractiveWebAssembly.Client.csproj │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ └── MainLayout.razor.css │ │ ├── Pages │ │ │ └── Home.razor │ │ ├── Program.cs │ │ ├── Routes.razor │ │ └── _Imports.razor │ └── BlazorInteractiveWebAssembly │ │ ├── BlazorInteractiveWebAssembly.csproj │ │ ├── Components │ │ ├── App.razor │ │ ├── Pages │ │ │ └── Error.razor │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ └── app.css └── BlazorSSRNoInteractivity │ ├── BlazorSSRNoInteractivity.csproj │ ├── Components │ ├── App.razor │ ├── Layout │ │ ├── MainLayout.razor │ │ └── MainLayout.razor.css │ ├── Pages │ │ ├── Error.razor │ │ └── Home.razor │ ├── Routes.razor │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ └── app.css ├── README.md ├── ReleaseNotes.md └── SimpleUISetupExamples.sln /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/BlazorInteractiveServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 |
15 | An unhandled error has occurred. 16 | Reload 17 | 🗙 18 |
19 | 20 | @code 21 | { 22 | protected override async Task OnAfterRenderAsync(bool firstRender) 23 | { 24 | if (firstRender) await init.InitializeTheme(); 25 | } 26 | } -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |
6 |

Hello, world!

7 |
15 | 16 | @code 17 | { 18 | bool showAlert; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveServer 10 | @using BlazorInteractiveServer.Components 11 | 12 | @using Sysinfocus.AspNetCore.Components 13 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorInteractiveServer.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents() 8 | .AddInteractiveServerComponents(); 9 | 10 | builder.Services.AddSysinfocus(); 11 | 12 | var app = builder.Build(); 13 | 14 | // Configure the HTTP request pipeline. 15 | if (!app.Environment.IsDevelopment()) 16 | { 17 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 18 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 19 | app.UseHsts(); 20 | } 21 | 22 | app.UseHttpsRedirection(); 23 | 24 | app.UseStaticFiles(); 25 | app.UseAntiforgery(); 26 | 27 | app.MapRazorComponents() 28 | .AddInteractiveServerRenderMode(); 29 | 30 | app.Run(); 31 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:30553", 8 | "sslPort": 44331 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5030", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7095;http://localhost:5030", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveServer/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box 5 | } 6 | 7 | .container { 8 | max-width: 1400px; 9 | margin: auto; 10 | padding: 1rem 11 | } 12 | 13 | .valid.modified:not([type=checkbox]) { 14 | outline: 1px solid #26b050; 15 | } 16 | 17 | .invalid { 18 | outline: 1px solid #e50000; 19 | } 20 | 21 | .validation-message { 22 | color: #e50000; 23 | } 24 |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LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 27 | padding: 1rem 1rem 1rem 3.7rem; 28 | color: white; 29 | } 30 | 31 | .blazor-error-boundary::after { 32 | content: "An error has occurred." 33 | } 34 | 35 | .darker-border-checkbox.form-check-input { 36 | border-color: #929292; 37 | } 38 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/BlazorInteractiveWebAssembly.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | Default 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 |
15 | An unhandled error has occurred. 16 | Reload 17 | 🗙 18 |
19 | 20 | @code 21 | { 22 | protected override async Task OnAfterRenderAsync(bool firstRender) 23 | { 24 | if (firstRender) await init.InitializeTheme(); 25 | } 26 | } -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |
6 |

Hello, world!

7 |
15 | 16 | @code 17 | { 18 | bool showAlert; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 5 | 6 | builder.Services.AddSysinfocus(); 7 | 8 | await builder.Build().RunAsync(); 9 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveWebAssembly.Client 10 | 11 | @using Sysinfocus.AspNetCore.Components 12 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveWebAssembly 10 | @using BlazorInteractiveWebAssembly.Client 11 | @using BlazorInteractiveWebAssembly.Components 12 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorInteractiveWebAssembly.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents() 8 | .AddInteractiveWebAssemblyComponents(); 9 | 10 | builder.Services.AddSysinfocus(); 11 | 12 | var app = builder.Build(); 13 | 14 | // Configure the HTTP request pipeline. 15 | if (app.Environment.IsDevelopment()) 16 | { 17 | app.UseWebAssemblyDebugging(); 18 | } 19 | else 20 | { 21 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 22 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 23 | app.UseHsts(); 24 | } 25 | 26 | app.UseHttpsRedirection(); 27 | 28 | app.UseStaticFiles(); 29 | app.UseAntiforgery(); 30 | 31 | app.MapRazorComponents() 32 | .AddInteractiveWebAssemblyRenderMode() 33 | .AddAdditionalAssemblies(typeof(BlazorInteractiveWebAssembly.Client._Imports).Assembly); 34 | 35 | app.Run(); 36 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:21737", 8 | "sslPort": 44360 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 17 | "applicationUrl": "http://localhost:5025", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 27 | "applicationUrl": "https://localhost:7077;http://localhost:5025", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET8/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box 5 | } 6 | 7 | .container { 8 | max-width: 1400px; 9 | margin: auto; 10 | padding: 1rem 11 | } 12 | 13 | .valid.modified:not([type=checkbox]) { 14 | outline: 1px solid #26b050; 15 | } 16 | 17 | .invalid { 18 | outline: 1px solid #e50000; 19 | } 20 | 21 | .validation-message { 22 | color: #e50000; 23 | } 24 | 25 | .blazor-error-boundary { 26 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4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 | } 30 | 31 | .blazor-error-boundary::after { 32 | content: "An error has occurred." 33 | } 34 | 35 | .darker-border-checkbox.form-check-input { 36 | border-color: #929292; 37 | } 38 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/BlazorSSRNoInteractivity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 | 23 | 24 | @code 25 | { 26 | protected override async Task OnAfterRenderAsync(bool firstRender) 27 | { 28 | if (firstRender) await init.InitializeTheme(); 29 | } 30 | } -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @attribute [StreamRendering] 3 | 4 | Home 5 | 6 |
7 |

Hello, world!

8 |
9 |
12 | 13 | 14 |

Because there is no interactivity, components will only render in their initial state and stay non-interactive.
However, if you chose to make a page interactive either Server of WebAssembly or even Auto, they will start working.

15 | 16 | @if (showAlert) 17 | { 18 | 19 | 20 | 21 | } 22 |
23 | 24 | @code 25 | { 26 | bool showAlert; 27 | DateTime? date; 28 | } -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorSSRNoInteractivity 10 | @using BlazorSSRNoInteractivity.Components 11 | 12 | @using Sysinfocus.AspNetCore.Components 13 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorSSRNoInteractivity.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents(); 8 | builder.Services.AddSysinfocus(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (!app.Environment.IsDevelopment()) 14 | { 15 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 16 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 17 | app.UseHsts(); 18 | } 19 | 20 | app.UseHttpsRedirection(); 21 | 22 | app.UseStaticFiles(); 23 | app.UseAntiforgery(); 24 | 25 | app.MapRazorComponents(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:48055", 8 | "sslPort": 44357 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5067", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7163;http://localhost:5067", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET8/BlazorSSRNoInteractivity/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box 5 | } 6 | 7 | .container { 8 | max-width: 1400px; 9 | margin: auto; 10 | padding: 1rem 11 | } 12 | 13 | .valid.modified:not([type=checkbox]) { 14 | outline: 1px solid #26b050; 15 | } 16 | 17 | .invalid { 18 | outline: 1px solid #e50000; 19 | } 20 | 21 | .validation-message { 22 | color: #e50000; 23 | } 24 | 25 | .blazor-error-boundary { 26 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZ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AyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 27 | padding: 1rem 1rem 1rem 3.7rem; 28 | color: white; 29 | } 30 | 31 | .blazor-error-boundary::after { 32 | content: "An error has occurred." 33 | } 34 | 35 | .darker-border-checkbox.form-check-input { 36 | border-color: #929292; 37 | } 38 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/BlazorInteractiveServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 |
15 | An unhandled error has occurred. 16 | Reload 17 | 🗙 18 |
19 | 20 | @code 21 | { 22 | protected override async Task OnAfterRenderAsync(bool firstRender) 23 | { 24 | if (firstRender) await init.InitializeTheme(); 25 | } 26 | } -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | color-scheme: light only; 3 | background: lightyellow; 4 | bottom: 0; 5 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 6 | box-sizing: border-box; 7 | display: none; 8 | left: 0; 9 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 10 | position: fixed; 11 | width: 100%; 12 | z-index: 1000; 13 | } 14 | 15 | #blazor-error-ui .dismiss { 16 | cursor: pointer; 17 | position: absolute; 18 | right: 0.75rem; 19 | top: 0.5rem; 20 | } 21 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |
6 |

Hello, world!

7 |
15 | 16 | @code 17 | { 18 | bool showAlert; 19 | } -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveServer 10 | @using BlazorInteractiveServer.Components 11 | 12 | @using Sysinfocus.AspNetCore.Components 13 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorInteractiveServer.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents() 8 | .AddInteractiveServerComponents(); 9 | 10 | builder.Services.AddSysinfocus(); 11 | 12 | var app = builder.Build(); 13 | 14 | // Configure the HTTP request pipeline. 15 | if (!app.Environment.IsDevelopment()) 16 | { 17 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 18 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 19 | app.UseHsts(); 20 | } 21 | 22 | app.UseHttpsRedirection(); 23 | 24 | 25 | app.UseAntiforgery(); 26 | 27 | app.MapStaticAssets(); 28 | app.MapRazorComponents() 29 | .AddInteractiveServerRenderMode(); 30 | 31 | app.Run(); 32 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5049", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7211;http://localhost:5049", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveServer/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box 5 | } 6 | 7 | .container { 8 | max-width: 1400px; 9 | margin: auto; 10 | padding: 1rem 11 | } 12 | 13 | .valid.modified:not([type=checkbox]) { 14 | outline: 1px solid #26b050; 15 | } 16 | 17 | .invalid { 18 | outline: 1px solid #e50000; 19 | } 20 | 21 | .validation-message { 22 | color: #e50000; 23 | } 24 | 25 | .blazor-error-boundary { 26 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUu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4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 27 | padding: 1rem 1rem 1rem 3.7rem; 28 | color: white; 29 | } 30 | 31 | .blazor-error-boundary::after { 32 | content: "An error has occurred." 33 | } 34 | 35 | .darker-border-checkbox.form-check-input { 36 | border-color: #929292; 37 | } 38 | 39 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 40 | color: var(--bs-secondary-color); 41 | text-align: end; 42 | } 43 | 44 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 45 | text-align: start; 46 | } -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/BlazorInteractiveWebAssembly.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | Default 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 |
15 | An unhandled error has occurred. 16 | Reload 17 | 🗙 18 |
19 | 20 | @code 21 | { 22 | protected override async Task OnAfterRenderAsync(bool firstRender) 23 | { 24 | if (firstRender) await init.InitializeTheme(); 25 | } 26 | } -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | color-scheme: light only; 3 | background: lightyellow; 4 | bottom: 0; 5 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 6 | box-sizing: border-box; 7 | display: none; 8 | left: 0; 9 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 10 | position: fixed; 11 | width: 100%; 12 | z-index: 1000; 13 | } 14 | 15 | #blazor-error-ui .dismiss { 16 | cursor: pointer; 17 | position: absolute; 18 | right: 0.75rem; 19 | top: 0.5rem; 20 | } 21 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |
6 |

Hello, world!

7 |
15 | 16 | @code 17 | { 18 | bool showAlert; 19 | } 20 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 5 | builder.Services.AddSysinfocus(); 6 | 7 | await builder.Build().RunAsync(); 8 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveWebAssembly.Client 10 | 11 | @using Sysinfocus.AspNetCore.Components -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorInteractiveWebAssembly 10 | @using BlazorInteractiveWebAssembly.Client 11 | @using BlazorInteractiveWebAssembly.Components 12 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorInteractiveWebAssembly.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents() 8 | .AddInteractiveWebAssemblyComponents(); 9 | 10 | builder.Services.AddSysinfocus(); 11 | 12 | var app = builder.Build(); 13 | 14 | // Configure the HTTP request pipeline. 15 | if (app.Environment.IsDevelopment()) 16 | { 17 | app.UseWebAssemblyDebugging(); 18 | } 19 | else 20 | { 21 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 22 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 23 | app.UseHsts(); 24 | } 25 | 26 | app.UseHttpsRedirection(); 27 | 28 | 29 | app.UseAntiforgery(); 30 | 31 | app.MapStaticAssets(); 32 | app.MapRazorComponents() 33 | .AddInteractiveWebAssemblyRenderMode() 34 | .AddAdditionalAssemblies(typeof(BlazorInteractiveWebAssembly.Client._Imports).Assembly); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 9 | "applicationUrl": "http://localhost:5151", 10 | "environmentVariables": { 11 | "ASPNETCORE_ENVIRONMENT": "Development" 12 | } 13 | }, 14 | "https": { 15 | "commandName": "Project", 16 | "dotnetRunMessages": true, 17 | "launchBrowser": true, 18 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 19 | "applicationUrl": "https://localhost:7080;http://localhost:5151", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET9/BlazorInteractiveWebAssembly/BlazorInteractiveWebAssembly/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { margin: 0; padding: 0; box-sizing: border-box } 2 | .container { 3 | max-width: 1400px; margin: auto; padding: 1rem 4 | } 5 | 6 | .valid.modified:not([type=checkbox]) { 7 | outline: 1px solid #26b050; 8 | } 9 | 10 | .invalid { 11 | outline: 1px solid #e50000; 12 | } 13 | 14 | .validation-message { 15 | color: #e50000; 16 | } 17 | 18 | .blazor-error-boundary { 19 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iP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3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 20 | padding: 1rem 1rem 1rem 3.7rem; 21 | color: white; 22 | } 23 | 24 | .blazor-error-boundary::after { 25 | content: "An error has occurred." 26 | } 27 | 28 | .darker-border-checkbox.form-check-input { 29 | border-color: #929292; 30 | } 31 | 32 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 33 | color: var(--bs-secondary-color); 34 | text-align: end; 35 | } 36 | 37 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 38 | text-align: start; 39 | } -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/BlazorSSRNoInteractivity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Initialization init 3 | 4 |
5 |
6 |

Brand Name

7 | 8 | 10 |
11 | @Body 12 |
13 | 14 | 23 | 24 | 25 | @code 26 | { 27 | protected override async Task OnAfterRenderAsync(bool firstRender) 28 | { 29 | if (firstRender) await init.InitializeTheme(); 30 | } 31 | } -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | color-scheme: light only; 3 | background: lightyellow; 4 | bottom: 0; 5 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 6 | box-sizing: border-box; 7 | display: none; 8 | left: 0; 9 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 10 | position: fixed; 11 | width: 100%; 12 | z-index: 1000; 13 | } 14 | 15 | #blazor-error-ui .dismiss { 16 | cursor: pointer; 17 | position: absolute; 18 | right: 0.75rem; 19 | top: 0.5rem; 20 | } 21 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @attribute [StreamRendering] 3 | 4 | Home 5 | 6 |
7 |

Hello, world!

8 |
9 |
12 | 13 | 14 |

Because there is no interactivity, components will only render in their initial state and stay non-interactive.
However, if you chose to make a page interactive either Server of WebAssembly or even Auto, they will start working.

15 | 16 | @if (showAlert) 17 | { 18 | 19 | 20 | 21 | } 22 |
23 | 24 | @code 25 | { 26 | bool showAlert; 27 | DateTime? date; 28 | } -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorSSRNoInteractivity 10 | @using BlazorSSRNoInteractivity.Components 11 | 12 | @using Sysinfocus.AspNetCore.Components -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorSSRNoInteractivity.Components; 2 | using Sysinfocus.AspNetCore.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents(); 8 | builder.Services.AddSysinfocus(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (!app.Environment.IsDevelopment()) 14 | { 15 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 16 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 17 | app.UseHsts(); 18 | } 19 | 20 | app.UseHttpsRedirection(); 21 | 22 | 23 | app.UseAntiforgery(); 24 | 25 | app.MapStaticAssets(); 26 | app.MapRazorComponents(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5259", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7091;http://localhost:5259", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /NET9/BlazorSSRNoInteractivity/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box 5 | } 6 | 7 | .container { 8 | max-width: 1400px; 9 | margin: auto; 10 | padding: 1rem 11 | } 12 | 13 | .valid.modified:not([type=checkbox]) { 14 | outline: 1px solid #26b050; 15 | } 16 | 17 | .invalid { 18 | outline: 1px solid #e50000; 19 | } 20 | 21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MTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 27 | padding: 1rem 1rem 1rem 3.7rem; 28 | color: white; 29 | } 30 | 31 | .blazor-error-boundary::after { 32 | content: "An error has occurred." 33 | } 34 | 35 | .darker-border-checkbox.form-check-input { 36 | border-color: #929292; 37 | } 38 | 39 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 40 | color: var(--bs-secondary-color); 41 | text-align: end; 42 | } 43 | 44 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 45 | text-align: start; 46 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sysinfocus simple/ui 2 | a Razor component library for Blazor, inspired by the shadcn/ui components. [Explore more about this UI Library @ BLAZOR.ART](https://blazor.art) 3 | 4 | # Get [Free UI Templates](https://github.com/Sysinfocus/simple-ui-templates) built using Sysinfocus simple/ui library. 5 | 6 | ## THIS LIBRARY IS NOW - **FREE TO USE** - FOR ALL 7 | Use the latest version 0.0.2.1 8 | 9 | ## Setup Instructions 10 | 11 | 1. Download the NuGet package `Sysinfocus.AspNetCore.Components` to your project. 12 | 13 | 2. Add `@using Sysinfocus.AspNetCore.Components` to your `_import.razor` file. 14 | 15 | 3. Add `builder.Services.AddSysinfocus(jsCssFromCDN: false);` to your `Program.cs` file. 16 | 17 | 4. Add the following CSS to your project's appropriate file as this depends upon the type of project being used. 18 | ``` 19 | /// For .NET 8 20 | 21 | 22 | 23 | /// For .NET 9 24 | 25 | 26 | ``` 27 | 28 | 5. Add the following initialization code to your `MainLayout.razor` or any layout file which you host the components. 29 | ``` 30 | @inherits LayoutComponentBase 31 | @inject Initialization init 32 | 33 |
// this is required for some components to close on click outside of its hosting component. 34 | @Body 35 |
36 | 37 | @code 38 | { 39 | protected override async Task OnAfterRenderAsync(bool firstRender) 40 | { 41 | // This initializes the theme for the components. 42 | // Then you can use init.ToggleTheme() to toggle between light and dark modes. 43 | if (firstRender) await init.InitializeTheme(); 44 | } 45 | } 46 | ``` 47 | 48 | 6. For non-interactive Blazor SSR, you need to add the `light` or `dark` class to `body` tag manually as it can't initialize automatically. 49 | 7. For more information, you can download the samples from this repo which has all these steps done and the projects are ready to explore. 50 | 8. To see the demo of each component, check out [Demo](https://blazor.art/) 51 | 9. Check out the [Release Notes](ReleaseNotes.md) 52 | 53 | --- 54 | 55 | For more information, you can download the samples from this repo which has all these steps done and the projects are ready to explore. 56 | To see the demo of each component, check out [Demo](https://blazor.art/) 57 | 58 | ## Have issues? 59 | Open an issue on this repo or email to issues@sysinfocus.com 60 | -------------------------------------------------------------------------------- /ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | Release notes for **Version 0.0.3.1** 4 | 5 | ## New / Updates / Bug fixes 6 | 1. Added **ServerSentEvents** component (a headless component to read SSE messages effortlessly). 7 | 1. Fixed **Input** component UI to always use width 100% for internal container. 8 | 1. Fixed **Select** component that was invoking submit action when used within **EditForm** component. 9 | 10 | --- 11 | 12 | Release notes for **Version 0.0.3.0** 13 | 14 | ## New / Updates / Bug fixes 15 | 1. Fixed **Input** component UI and binding issue. 16 | 1. Added `DisableMove` property to **Pills** component. 17 | 1. Other minor UI fixes. 18 | 19 | --- 20 | 21 | Release notes for **Version 0.0.2.9** 22 | 23 | ## New / Updates / Bug fixes 24 | 1. Updated **Input** component to support Format attribute and bug fixes. 25 | 1. Updated **Treeview** component to raise `OnExpanded` and `OnCollapsed` events only on parent nodes. 26 | 1. Added `Prefix` and `Suffix` attributes to **Input** component. 27 | 1. Added `GetInnerText`, `GetInnerHtml`, `SetInnerText` and `SetInnerHtml` methods to **BrowserExtensions**. 28 | 1. Added **MarkdownPreview** component. 29 | 1. Other minor UI fixes. 30 | 31 | --- 32 | 33 | Release notes for **Version 0.0.2.8** 34 | 35 | ## New / Updates / Bug fixes 36 | 1. Fixed bug for **Tabs** component which was not allowing programmatically change of tabs. 37 | 1. Updates **Scheduler** component to show proper week days starting from Monday. 38 | 1. Other minor UI fixes. 39 | 40 | --- 41 | 42 | Release notes for **Version 0.0.2.7** 43 | 44 | ## New / Updates / Bug fixes 45 | 1. **ResizeObserver** component added for anything to monitor for change in dimensions using Css selector. 46 | 1. Fixed bug for `scrollIntoViewIfNeeded` call in JSInterop for **Presenter** component, instead now uses **ResizeObserver** to update the size on dimension changes. 47 | 1. Other minor UI fixes. 48 | 49 | --- 50 | 51 | Release notes for **Version 0.0.2.6** 52 | 53 | ## New / Updates / Bug fixes 54 | 1. **TabPages** component added. 55 | 1. **Presenter** component added. 56 | 1. **Pills** component added. 57 | 1. Updated **Input** component to use `Format` parameter for displaying numbers, date and time with respective formats. 58 | 1. Fixed **Tabs** component issue where it was triggering tab change on events fired on other components. 59 | 1. Streamlined the box-shadow for all components. 60 | 1. Other minor UI fixes. 61 | 62 | --- 63 | 64 | Release notes for **Version 0.0.2.5** 65 | 66 | ## New / Updates / Bug fixes 67 | 1. **Sidebar** component added with 2 types - `Simple` and `Multi-level` which can be switched by `IsSimpleSidebar` boolean parameter. 68 | 1. **Timeline** component added. 69 | 1. Updated the **BrowserExtensions** with `AddClass` and `RemoveClass` methods. 70 | 1. Other minor UI fixes. 71 | 72 | --- 73 | 74 | Release notes for **Version 0.0.2.4** 75 | 76 | ## New / Updates / Bug fixes 77 | 1. **ColorPicker** component added. 78 | 1. **Notification** component added (preview for testing purpose). 79 | 1. Updated **Icon** component to support Microsoft FluentUI Icons and Lucide Icons. 80 | 1. Updated the **BrowserExtensions** with `GetUserAgent`, `GetPlatform`, `GetTextFromClipboard`, `SetTextToClipboard`, `InvokePrint` and `InvokeShare` methods. 81 | 1. Other minor UI fixes. 82 | 83 | --- 84 | 85 | Release notes for **Version 0.0.2.3** 86 | 87 | ## Updates / Bug fixes 88 | 1. Fixed UI issue in **Editor** component for UL, OL and Colors. 89 | 1. Updated the **BrowserExtensions** with `IsPWA`, `ToggleFullscreen`, `Debounce`, `SetElementWidth`, `SetElementHeight` and `GetClientRectForElement` methods. 90 | 1. Other minor UI fixes. 91 | 92 | --- 93 | 94 | Release notes for **Version 0.0.2.2** 95 | 96 | ## Updates / Bug fixes 97 | 1. Fixed bug in **Dialog** component which was shifting focus to the first element always. 98 | 1. Added **Animate**, **Text** and **Icon** components. 99 | 100 | --- 101 | 102 | Release notes for **Version 0.0.2.1** 103 | 104 | ## Updates / Bug fixes 105 | 1. Fixed UI issues. 106 | 1. Removed license key requirements and made the library FREE FOR ALL. 107 | 108 | --- 109 | 110 | Release notes for **Version 0.0.2** 111 | 112 | ## Updates / Bug fixes 113 | 1. Fixed bugs in **Slider** component. 114 | 1. Updated attributes in **Textarea** component. 115 | 1. Updated attributes in **Swipe** component. 116 | 1. Other minor UI fixes for various components. 117 | 118 | --- 119 | 120 | Release notes for **Version 0.0.1.9** 121 | 122 | ## Updates / Bug fixes 123 | 1. Updated **CodeScanner** component to start and stop using `bool` flag. 124 | 1. Added `Controls` bool flag to hide the camera list and button. 125 | 1. Fixed bug in **Checkbox** component, now showing the outline for label. 126 | 1. Fixed bug in **Radio** component, now showing the outline for label. 127 | 128 | --- 129 | 130 | Release notes for **Version 0.0.1.8** 131 | 132 | ## Updates / Bug fixes 133 | 1. Fixed bug with **CodeScanner** component for missing assembly reference. 134 | 1. Added **FileManager** component. 135 | 136 | --- 137 | 138 | Release notes for **Version 0.0.1.7** 139 | 140 | ## Updates / Bug fixes 141 | 1. Added `ClearState` and `PopFromState` methods for `StateManager` to clear memory. 142 | 1. Fixed issues with **GeoLocation** component registering DotNet reference. 143 | 144 | --- 145 | 146 | Release notes for **Version 0.0.1.6** 147 | 148 | ## Updates / Bug fixes 149 | 1. **SaveFilePicker** component updated to fallback to regular download, in case any browser doesn't support the new APIs. 150 | 1. Added new method to preload JS and CSS either all or some of the dependencies using `PreloadJSAndCSSDependencies` method of the ``Initialization`` class. This needs to be called in the **Layouts**. 151 | 1. Fixed tab focus issues for **Dialog** and **Alert Dialog** components. 152 | 153 | --- 154 | 155 | Release notes for **Version 0.0.1.5** 156 | 157 | ## Updates / Bug fixes 158 | 1. **SpeechToText** component added. 159 | 1. **TextToSpeech** component added. 160 | 1. Added new property **ReadOnly** for **Input** and **TextArea** components. 161 | 1. Fixed UI for **Verify Human** component. 162 | 1. Now the JS and CSS dependencies are used from local components' folder. If you want them to be served from CDNs, you can use the **AddSysinfocus** method's `jsCssFromCDN` parameter and set it to `true`, which toggle's this feature. 163 | 164 | --- 165 | 166 | Release notes for **Version 0.0.1.4** 167 | 168 | ## Bug fixes 169 | 1. Fixed the issue in **Popover** component - [GitHub Issues #2](https://github.com/Sysinfocus/simple-ui/issues/2). 170 | 1. **Verify Human** component added. 171 | 172 | --- 173 | 174 | Release notes for **Version 0.0.1.3** 175 | 176 | ## Bug fixes 177 | 1. Fixed the issue in Select component. 178 | 179 | --- 180 | 181 | Release notes for **Version 0.0.1.2** 182 | 183 | ## Updates / Bug fixes 184 | 185 | 1. Added new event for marker movement `OnMarkerMoved` for **Maps** component. 186 | 1. Added `DistanceKilometers` and `DistanceMiles` methods to get distance between 2 locations in **Geolocation** component. 187 | 1. **Treeview** component added. 188 | 1. Following components have been made available in free tier. 189 | - Accordion 190 | - Alert 191 | - Dialog 192 | - Navigation Menu 193 | - Select 194 | - Table 195 | 196 | --- 197 | 198 | Release notes for **Version 0.0.1.1** 199 | 200 | ## Bug fixes 201 | 202 | 1. Fixed input issue and dark theme forecolor issue in **ComboBox** component. 203 | 1. Fixed the **Accordion** component animation. 204 | 1. Fixed the tab button spacings in **Tabs** component for vertical direction. 205 | 1. Fixed the **Signature** component bounce issue when using on touch devices. 206 | 1. Updated **Button** component with Success, Warning and Info types. 207 | 1. Updated **Alert** component with Success, Warning and Info types. 208 | 1. Updated **Badge** component with Success, Warning and Info types. 209 | 210 | --- 211 | 212 | For more information, you can download the samples from this repo which has all these steps done and the projects are ready to explore. 213 | To see the demo of each component, check out [Demo](https://blazor.art/) 214 | 215 | ## Have issues? 216 | Open an issue on this repo or email to issues@sysinfocus.com 217 | -------------------------------------------------------------------------------- /SimpleUISetupExamples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35309.182 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NET8", "NET8", "{801DD2FB-228A-42F9-8A67-59B945F90B3B}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NET9", "NET9", "{7ACB1A77-C134-49B8-B1C3-4ECA45E7DADD}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorSSRNoInteractivity", "NET9\BlazorSSRNoInteractivity\BlazorSSRNoInteractivity.csproj", "{2B6F49E9-495C-4D83-A64D-CF3C564D8016}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveServer", "NET9\BlazorInteractiveServer\BlazorInteractiveServer.csproj", "{0FE97EA3-F671-4389-B6D0-AD64AE0C99BF}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveWebAssembly", "NET9\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly.csproj", "{06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveWebAssembly.Client", "NET9\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly.Client\BlazorInteractiveWebAssembly.Client.csproj", "{5412BD8C-8EA9-4F1F-B45C-2150F466DC6D}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveServer", "NET8\BlazorInteractiveServer\BlazorInteractiveServer.csproj", "{AD833A6A-82F9-4F77-8BE6-EF2D156F62F3}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveWebAssembly", "NET8\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly.csproj", "{729862E1-24E3-40AB-8E00-DB17EB0CAA09}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorInteractiveWebAssembly.Client", "NET8\BlazorInteractiveWebAssembly\BlazorInteractiveWebAssembly.Client\BlazorInteractiveWebAssembly.Client.csproj", "{308D86F2-A891-4C3B-80B8-26CCFDE34809}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorSSRNoInteractivity", "NET8\BlazorSSRNoInteractivity\BlazorSSRNoInteractivity.csproj", "{E56C5EAD-34E5-4E87-9110-F9485024BA76}" 25 | EndProject 26 | Global 27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 28 | Debug|Any CPU = Debug|Any CPU 29 | Release|Any CPU = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {2B6F49E9-495C-4D83-A64D-CF3C564D8016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {2B6F49E9-495C-4D83-A64D-CF3C564D8016}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {2B6F49E9-495C-4D83-A64D-CF3C564D8016}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {2B6F49E9-495C-4D83-A64D-CF3C564D8016}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {0FE97EA3-F671-4389-B6D0-AD64AE0C99BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {0FE97EA3-F671-4389-B6D0-AD64AE0C99BF}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {0FE97EA3-F671-4389-B6D0-AD64AE0C99BF}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {0FE97EA3-F671-4389-B6D0-AD64AE0C99BF}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {5412BD8C-8EA9-4F1F-B45C-2150F466DC6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {5412BD8C-8EA9-4F1F-B45C-2150F466DC6D}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {5412BD8C-8EA9-4F1F-B45C-2150F466DC6D}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {5412BD8C-8EA9-4F1F-B45C-2150F466DC6D}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {AD833A6A-82F9-4F77-8BE6-EF2D156F62F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {AD833A6A-82F9-4F77-8BE6-EF2D156F62F3}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {AD833A6A-82F9-4F77-8BE6-EF2D156F62F3}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {AD833A6A-82F9-4F77-8BE6-EF2D156F62F3}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {729862E1-24E3-40AB-8E00-DB17EB0CAA09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {729862E1-24E3-40AB-8E00-DB17EB0CAA09}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {729862E1-24E3-40AB-8E00-DB17EB0CAA09}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {729862E1-24E3-40AB-8E00-DB17EB0CAA09}.Release|Any CPU.Build.0 = Release|Any CPU 56 | {308D86F2-A891-4C3B-80B8-26CCFDE34809}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {308D86F2-A891-4C3B-80B8-26CCFDE34809}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {308D86F2-A891-4C3B-80B8-26CCFDE34809}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {308D86F2-A891-4C3B-80B8-26CCFDE34809}.Release|Any CPU.Build.0 = Release|Any CPU 60 | {E56C5EAD-34E5-4E87-9110-F9485024BA76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {E56C5EAD-34E5-4E87-9110-F9485024BA76}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {E56C5EAD-34E5-4E87-9110-F9485024BA76}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {E56C5EAD-34E5-4E87-9110-F9485024BA76}.Release|Any CPU.Build.0 = Release|Any CPU 64 | EndGlobalSection 65 | GlobalSection(SolutionProperties) = preSolution 66 | HideSolutionNode = FALSE 67 | EndGlobalSection 68 | GlobalSection(NestedProjects) = preSolution 69 | {2B6F49E9-495C-4D83-A64D-CF3C564D8016} = {7ACB1A77-C134-49B8-B1C3-4ECA45E7DADD} 70 | {0FE97EA3-F671-4389-B6D0-AD64AE0C99BF} = {7ACB1A77-C134-49B8-B1C3-4ECA45E7DADD} 71 | {06F32EA8-D6EC-48D1-A4FC-6E229FDD2A46} = {7ACB1A77-C134-49B8-B1C3-4ECA45E7DADD} 72 | {5412BD8C-8EA9-4F1F-B45C-2150F466DC6D} = {7ACB1A77-C134-49B8-B1C3-4ECA45E7DADD} 73 | {AD833A6A-82F9-4F77-8BE6-EF2D156F62F3} = {801DD2FB-228A-42F9-8A67-59B945F90B3B} 74 | {729862E1-24E3-40AB-8E00-DB17EB0CAA09} = {801DD2FB-228A-42F9-8A67-59B945F90B3B} 75 | {308D86F2-A891-4C3B-80B8-26CCFDE34809} = {801DD2FB-228A-42F9-8A67-59B945F90B3B} 76 | {E56C5EAD-34E5-4E87-9110-F9485024BA76} = {801DD2FB-228A-42F9-8A67-59B945F90B3B} 77 | EndGlobalSection 78 | GlobalSection(ExtensibilityGlobals) = postSolution 79 | SolutionGuid = {A84617A8-EC10-469B-BA7F-658284716AEA} 80 | EndGlobalSection 81 | EndGlobal 82 | --------------------------------------------------------------------------------