NetBricks 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NetBricks --version 1.0.0
                    
NuGet\Install-Package NetBricks -Version 1.0.0
                    
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="NetBricks" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetBricks" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetBricks" />
                    
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 NetBricks --version 1.0.0
                    
#r "nuget: NetBricks, 1.0.0"
                    
#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 NetBricks@1.0.0
                    
#: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=NetBricks&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetBricks&version=1.0.0
                    
Install as a Cake Tool

Why NetBricks?

I found myself using a lot of the same code and techniques from project-to-project, however, I was always copying the code and then it would deviate. I decided instead to take the best components from all my recent solutions and put the base level components into something I am calling NetBricks.

Included:

  • Config
  • AccessTokenFetcher
  • SingleLineConsoleLogger

Services

The entire solution depends on Dependency Injection. If you want everything, you should inject the following services...

services.AddHttpClient("netbricks");
services.AddSingleLineConsoleLogger();
services.AddAccessTokenFetcher();
services.AddConfig();

Config

This is a flexible and efficient configuration management solution that supports the following features:

  • values can be pulled from environment variables
  • values can be pulled from Azure App Configuration
  • values that are URLs can be resolved to secrets in Azure Key Vault
  • values can be cached
  • values can be converted to the appropriate datatype
  • defaults can be set

GetOnce()

If you need access to a value, don't need to resolve in Key Vault, and don't need to cache, use GetOnce(). You might also consider doing it as "static" since it has no requirement for an instance.

public static LogLevel LogLevel
{
    get => GetOnce("APP_LOG_LEVEL", "LOG_LEVEL").AsEnum<LogLevel>(() => LogLevel.Information);
}

More to come...

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetBricks:

Package Downloads
CasAuth

The Comprehensive Authentication Solution (or CasAuth) was developed to provide an opinionated way to handle user and service authentication for APIs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 949 12/2/2025
2.0.2 516 8/6/2025
2.0.1 218 6/28/2025
2.0.0 332 5/6/2025
1.9.2 1,754 4/30/2024
1.9.1 244 4/29/2024
1.9.0 1,906 4/22/2024
1.8.0 327 4/19/2024
1.7.2 9,526 1/3/2023
1.7.1 2,855 7/8/2022
1.7.0 4,587 7/8/2022
1.6.2 2,719 6/15/2022
1.6.1 791 6/15/2022
1.6.0 3,913 2/28/2022
1.5.0 1,748 1/19/2022
1.4.1 822 1/19/2022
1.4.0 809 1/19/2022
1.3.0 1,234 9/8/2020
1.2.0 996 7/7/2020
1.1.0 698 7/7/2020
1.0.0 1,119 5/21/2020