devdeer.Libraries.AspNetCore.Blazor 0.2.2

dotnet add package devdeer.Libraries.AspNetCore.Blazor --version 0.2.2
                    
NuGet\Install-Package devdeer.Libraries.AspNetCore.Blazor -Version 0.2.2
                    
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="devdeer.Libraries.AspNetCore.Blazor" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="devdeer.Libraries.AspNetCore.Blazor" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="devdeer.Libraries.AspNetCore.Blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add devdeer.Libraries.AspNetCore.Blazor --version 0.2.2
                    
#r "nuget: devdeer.Libraries.AspNetCore.Blazor, 0.2.2"
                    
#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.
#:package devdeer.Libraries.AspNetCore.Blazor@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=devdeer.Libraries.AspNetCore.Blazor&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=devdeer.Libraries.AspNetCore.Blazor&version=0.2.2
                    
Install as a Cake Tool

devdeer.Libraries.AspNetCore.Blazor

NuGet Downloads

Disclaimer

If you want to use this package you should be aware of some principles and practices we at DEVDEER use. So be aware that this is not backed by a public repository. The purpose here is to give out customers easy access to our logic. Nevertheless you are welcome to use this lib if it provides any advantages.

Summary

This package provides logic and components needed to run Blazor apps in a way, DEVDEER would do it. So all of this is highly oppniniated as stated before. It brings MudBlazor as a dependency because it provides components to use in applications which are based on that framework.

Usage

After you installed a Razor application this needs to be placed in your Program.cs at a minimum:

using devdeer.Libraries.AspNetCore.Blazor;
using devdeer.Libraries.Hosting.Extensions;
using devdeer.Scotty.Ui.Web.Components;

await BlazorRunner<App>.StartAsync(
    args,
    opt =>
    {        
        opt.AfterDefaultServicesConfigured = b =>
        {
            b.ConfigureDefaults(false, "WebApp");
        };     
    });

After this your app should run just fine and you should Serilog based log formats during debugging.

If you need to use Entra ID auth just add this to your configuration (appsettings.json is shown here):

{
    "EntraId": {
        "Instance": "https://login.microsoftonline.com/",
        "TenantId": "YOUR_TENANT_ID",
        "Domain": "YOUR_TENANT_DOMAIN",
        "UsePKCE": false,
        "Scopes": [ "User.Read" ]
    },
    "DownstreamApis": {
        "Graph": {
            "BaseUrl": "https://graph.microsoft.com/v1.0",
            "Scopes": [ "User.Read" ],
            "AcquireTokenOptions": {
                "AuthenticationOptionsName": "OpenIdConnect"
            }
        }
    }
}

Also ensure that your appsettings.Development.json contains:

{
    "EntraId": {
        "ClientId": "YOUR_CLIENT_ID"       
    },
    "DownstreamApis": {
        "MyAPI": {
            "BaseUrl": "YOUR_API_BASE_URL",            
            "Scopes": [ "YOUR_API_SCOPE" ],
            "AcquireTokenOptions": {
                "AuthenticationOptionsName": "OpenIdConnect"
            }
        }
    }
}

This assumes you use OIDC as you can see. The custom downstream API "MyAPI" is totally optional. The same applies to "Graph".

As soon as you did this, the App will require an authenticated user. You then could use the Razor-Component GraphAvatar to prove that:

@using devdeer.Libraries.AspNetCore.Blazor.Components
@inherits LayoutComponentBase

<MudThemeProvider Theme="@_theme" IsDarkMode="_isDarkMode" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
<MudLayout>
    <MudAppBar Elevation="1">
        <MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start"
                       OnClick="@(e => DrawerToggle())" />
        <MudText Typo="Typo.h5" Class="ml-3">Scotty</MudText>
        <MudSpacer />
        <MudIconButton Icon="@(DarkLightModeButtonIcon)" Color="Color.Inherit" OnClick="@DarkModeToggle" />
        <GraphAvatar />
    </MudAppBar>
    <MudDrawer id="nav-drawer" @bind-Open="_drawerOpen" Variant="DrawerVariant.Mini" ClipMode="DrawerClipMode.Always" Elevation="2">
        <NavMenu />
    </MudDrawer>
    <MudMainContent Class="pt-16 pa-4">
        @Body
    </MudMainContent>
</MudLayout>

More Details

Refer to The DEVDEER docs for further details.

Authentication

If the EntraId config option is set we automatically configure authentication to EntraId or Azure AD B2C/Entra ID Extenal Identities.

About DEVDEER

DEVDEER is a company from Magdeburg, Germany which is specialized in consulting, project management and development. We are very focussed on Microsoft Azure as a platform to run our products and solutions in the cloud. So all of our backend components usually runs in this environment and is developed using .NET. In the frontend area we are using react and a huge bunch of packages to build our UIs.

You can find us online:

Website

GitHub GitHub Org's stars

YouTube

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
0.2.2 0 10/22/2026
0.2.1 0 10/22/2026
0.2.0 0 10/22/2026
0.1.2-alpha 37 10/20/2026
0.1.1-alpha 34 10/20/2026
0.1.0-alpha 40 10/20/2026

- First release.