Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Web Development with Blazor

You're reading from   Web Development with Blazor A practical guide to start building interactive UIs with C# 11 and .NET 7

Arrow left icon
Product type Paperback
Published in Mar 2023
Publisher Packt
ISBN-13 9781803241494
Length 360 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jimmy Engström Jimmy Engström
Author Profile Icon Jimmy Engström
Jimmy Engström
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Hello Blazor 2. Creating Your First Blazor App FREE CHAPTER 3. Managing State – Part 1 4. Understanding Basic Blazor Components 5. Creating Advanced Blazor Components 6. Building Forms with Validation 7. Creating an API 8. Authentication and Authorization 9. Sharing Code and Resources 10. JavaScript Interop 11. Managing State – Part 2 12. Debugging the Code 13. Testing 14. Deploy to Production 15. Moving from, or Combining, an Existing Site 16. Going Deeper into WebAssembly 17. Examining Source Generators 18. Visiting .NET MAUI 19. Where to Go from Here 20. Other Books You May Enjoy
21. Index

Setting up your development environment

In this book, the focus will be on Windows development, and any screenshots are going to be from Visual Studio (unless stated otherwise). But since .NET 7 is cross-platform, we will go through how to set up your development environment on Windows, macOS, and Linux.

The go-to link for all the platforms can be found at https://visualstudio.microsoft.com/.

We can download Visual Studio, Visual Studio Code, or Visual Studio for Mac from the web page.

Windows

On Windows, we have many different options for developing Blazor applications. Visual Studio 2022 is the most powerful tool we can use.

There are three different editions, which are as follows:

  • Community 2022
  • Professional 2022
  • Enterprise 2022

In short, the Community Edition is free, while the others cost money. The Community Edition does have some limitations, and we can compare the different editions here: https://visualstudio.microsoft.com/vs/compare/.

For this book, we can use any of these versions. Take the following steps:

  1. Download Visual Studio 2022 from https://visualstudio.microsoft.com/vs/. Choose the version that is right for you.
  2. Install Visual Studio and during the installation, make sure to select ASP.NET and web development, as shown in Figure 2.1:

Figure 2.1: Visual Studio 2022 installation on Windows

  1. To the right is a list of all the components that will be installed. Check .NET WebAssembly Build Tools.

We can also use Visual Studio Code to develop Blazor on Windows, but we won’t discuss the installation process for Windows.

macOS

On macOS, we also have some options. Visual Studio for Mac is the most powerful IDE we can use.

Download Visual Studio for Mac from https://visualstudio.microsoft.com/vs/mac/ as follows:

  1. Click on the Download Visual Studio for Mac button.
  2. Open the file that we downloaded.

Make sure to select .NET, as shown in Figure 2.2:

No description available.

Figure 2.2: Visual Studio for Mac installation screen

Since Visual Studio Code is a cross-platform software, we can use it here as well.

Linux (or macOS or Windows)

Visual Studio Code is cross-platform, which means we can use it on Linux, macOS, or Windows.

The different versions are available at https://code.visualstudio.com/Download.

Once installed, we also need to add two extensions:

  1. Open Visual Studio Code and press Ctrl + Shift + X.
  2. Search for C# for Visual Studio Code (powered by OmniSharp) and click Install.
  3. Search for JavaScript Debugger (Nightly) and click Install.

To create a project, we can use the .NET CLI, which we will return to throughout this book, but we won’t do a deep dive into the .NET CLI.

Now that everything is set up, let’s create our first app.

You have been reading a chapter from
Web Development with Blazor - Second Edition
Published in: Mar 2023
Publisher: Packt
ISBN-13: 9781803241494
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime