This book is dedicated to my son, Archie.
front matter
preface
Ive been an ASP.NET developer for over 17 years now. I love working with ASP.NET Core and the C# language. But there was always an element missing for me....
Since I was young, Ive enjoyed building web UIs. When I was 15, my best friend and I decided to build a website about the Quake games we enjoyed playing. He built the backend while I built the UI. I remember spending hours and days creating nested tables and inline styles to create the look we wanted for the site. This seems torturous now, but I really loved it at the time. Throughout my resulting career, Ive really enjoyed building the client-side experience, but this has always taken me away from C# and ASP.NET Core. Instead, Ive learned JavaScript and various frameworks and tooling that are popular in that ecosystem. While I enjoyed JavaScript, I really wanted to be using my favorite language, C#, when building client-side web applications.
Then one day in February 2018, I stumbled across a video of Steve Sanderson at NDC Oslo 2017 ( https://youtu.be/MiLAE6HMr10 ). In this talk, he presented an experiment he had built that took a portable .NET run time called Dot Net Anywhere and compiled it to a format called WebAssembly. He used this as a base to create a framework that allowed client-side web applications to be built using Razor (a mix of C#, HTML, and CSS) that ran entirely in the browser. He called it Blazor.
The first experimental preview of Blazor was released by Microsoft on March 22, 2018, with new previews almost every month. I followed along with each preview, trying out the new features and writing blog posts about my experiences. On April 18, 2019, Daniel Roth published a blog post announcing that it was moving out of the experimental phase and Microsoft had committed to ship it as a supported web UI framework. Finally, the missing element!
Since that blog post, Blazor has gone from strength to strength. Additional hosting models have been added, allowing Blazor to run in more places. With .NET 6, weve seen some of the biggest leaps forward with the framework. AOT (ahead-of-time) mode has been introduced, producing huge performance improvements for Blazor WebAssembly applications. The evolution of Xamarin, .NET MAUI, allows Blazor to move out of the browser and be used to create cross-platform desktop and mobile applications.
This book is the result of my journey with Blazor from that first time watching Steves NDC Oslo presentation to building production applications today. To date, Ive published over 75 blog posts about Blazor on my personal blog and have written many for other publications. Blazor also gave me a passion for public speaking, first at .NET user groups and eventually at international conferences. I even got to give a talk on Blazor at NDC Oslo in room 7, the same room that Steve was in when he first presented his experiment a few years earlier.
acknowledgments
This book has been one of the hardest projects of my life, and while it has my name on the cover, it was only possible with the help of many other people. Id like to take this opportunity to say a huge thank-you to those people.
First and foremost, I want to thank my wife, Robyn. You have been my rock throughout the last year and a half. You have had to deal with me at my worst during this time, but your unwavering support and encouragement made me believe that I could finish this. I will always be grateful for that, and I love you very much.
Id also like to thank my whole family for their support and encouragementespecially my dad, who talked me out of quitting at one point when I completely lost faith.
Next, Id like to thank some amazing people at Manning without whom this book would not exist. Brian Sawyer recruited me, convinced me to write a proposal, and that I could pull it off! Kristen Watterson, my developmental editor for almost the entire project, helped shape the book into what it is today. Toni Arritola stepped in at the eleventh hour to get the book over the line. Andrew West, my technical developmental editor, made sure my code made sense and actually worked. Finally, Karthikeyarajan Rajendran did a great job with the final technical proofread of the book. Thanks also to the production team at Manning for all their hard work in producing this book.
Also, a special thanks to all the reviewers for their comments and feedback: Al Pezewski, Alberto Acerbis, Ashwini Gupta, Bruno Sonnino, Grant Colley, Jason Hales, Jeff Smith, Jim Wilson, John Rhodes, Kalyan Chanumolu, Marcin Sk, Mark Chalkley, Mike Ted, Pedro Seromenho, Richard Michaels, Rohit Sharma, Ron Lease, Rui Ribeiro, Steve Goodman, Tanya Wilke, Thomas Gueth, and Wayne Matheryou made this a better book.