Hona.Blazor.GrpcWeb.DevTools 1.0.1

dotnet add package Hona.Blazor.GrpcWeb.DevTools --version 1.0.1                
NuGet\Install-Package Hona.Blazor.GrpcWeb.DevTools -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hona.Blazor.GrpcWeb.DevTools" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hona.Blazor.GrpcWeb.DevTools --version 1.0.1                
#r "nuget: Hona.Blazor.GrpcWeb.DevTools, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hona.Blazor.GrpcWeb.DevTools as a Cake Addin
#addin nuget:?package=Hona.Blazor.GrpcWeb.DevTools&version=1.0.1

// Install Hona.Blazor.GrpcWeb.DevTools as a Cake Tool
#tool nuget:?package=Hona.Blazor.GrpcWeb.DevTools&version=1.0.1                

Introduction

NuGet Downloads (official NuGet)

gRPC-Web is becoming increasingly popular in the .NET world and, of course, in Blazor.

But not only the technology, also the tooling for gRPC-Web has an important role. For some time now, there has been a Chrome browser extension for the gRPC-Web Developer Tools.

I have made it my task to make this incredibly useful tool also usable for Blazor 😃

Getting started

Prerequisites

You need .NET 7.0 or newer to use this library.

Download .NET 7 Download .NET 8

You also need the gRPC-Web Developer Tools Chrome Extsion

Install gRPC-Web Developer Tools

Platform support

The gRPC-Web Developer Tools only available for Google Chrome and Microsoft Edge browser.

Installation

You can install the package via NuGet with the Package Manager in your IDE or alternatively using the command line:

dotnet add package PatrickJahr.Blazor.GrpcWebDevTools

Usage

The package can be used in Blazor WebAssembly projects.

Enable gRPC-Web Developer Tools on your project

At first you have to register a GrpcChannel in your ServiceCollection like this:

builder.Services.AddScoped(services =>
{
    var channel = GrpcChannel.ForAddress(backendUrl,
        new GrpcChannelOptions
        {
            HttpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler())
        });

    return channel;
});

Then you can add your gRPC-Services with the extension method AddGrpcService<T>:

builder.Services.AddGrpcService<IConferencesService>();
builder.Services.AddGrpcService<ITimeService>();

To enable the gRPC-Web Developer Tools on your project you have two opportunities:

  • First you can enable them via the AppSettings:
{
  "GrpcDevToolsEnabled": true
}
  • Or you can enable them with the extension method EnableGrpcWebDevTools in your Program.cs:
builder.Services.EnableGrpcWebDevTools();

License and Note

BSD-3-Clause.

This is a technical showcase, not an official PatrickJahr product.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 789 9/5/2024