Blazicons.Generating
3.3.35
dotnet add package Blazicons.Generating --version 3.3.35
NuGet\Install-Package Blazicons.Generating -Version 3.3.35
<PackageReference Include="Blazicons.Generating" Version="3.3.35"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Blazicons.Generating" Version="3.3.35" />
<PackageReference Include="Blazicons.Generating"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Blazicons.Generating --version 3.3.35
#r "nuget: Blazicons.Generating, 3.3.35"
#:package Blazicons.Generating@3.3.35
#addin nuget:?package=Blazicons.Generating&version=3.3.35
#tool nuget:?package=Blazicons.Generating&version=3.3.35
Blazicons.Generating
Provides support for generating Blazicon library packages.
See the changelog for change history.
Overview
Blazicons.Generating is a library designed to assist in generating code for Blazicon icon library implementations. It does this by providing helper classes for reading the source repositories of open-source font libraries and for the generation of Blazicon libraries.
Getting Started
Installation
Add a reference to the Blazicons.Generating package in your project.
Basic Configuration
Configure your .csproj file with the required properties to generate icon classes:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<BlaziconsRepoUrl>https://github.com/example/icons/archive/refs/heads/main.zip</BlaziconsRepoUrl>
<BlaziconsSvgPattern>^src\/svg\/.*.svg$</BlaziconsSvgPattern>
<BlaziconsClassName>MyIcon</BlaziconsClassName>
<BlaziconsSvgFolderPath>src/svg</BlaziconsSvgFolderPath>
<BlaziconsPropertyNameRemovalPatterns>^My_Icon_;_24_\w*$;-(original|plain|line)</BlaziconsPropertyNameRemovalPatterns>
<BlaziconsSkipColorScrub>true</BlaziconsSkipColorScrub>
<BlaziconsGeneratedCodeOutputPath>Generated</BlaziconsGeneratedCodeOutputPath>
<BlaziconsGeneratorPath>MyIcons.Generating/MyIcons.Generating.MyIconsGenerator</BlaziconsGeneratorPath>
</PropertyGroup>
</Project>
Property Name Transformation Examples:
Patterns are applied in order. Use regex anchors to control where matching occurs:
^pattern- Removes from the start (prefix removal)pattern$- Removes from the end (suffix removal)pattern- Removes anywhere in the filename
Example with the above configuration:
Ic_Fluent_Activity_24_regular.svg→Activity(prefix^Ic_Fluent_removed, then suffix_24_\w*$removed)Ic_Fluent_Person_24_filled.svg→Person(prefix^Ic_Fluent_removed, then suffix_24_\w*$removed)react-plain.svg→React(pattern-(original|plain|line)removed)angular-original.svg→Angular(pattern-(original|plain|line)removed)
Configuration Properties
| Property | Required | Description | Example |
|---|---|---|---|
BlaziconsRepoUrl |
Yes* | URL to a .zip file containing the icon repository | https://github.com/my-team/myicons/archive/refs/heads/main.zip |
BlaziconsRepoPath |
Yes* | Local path to a repository (alternative to RepoUrl) | C:\Source\icons |
BlaziconsSvgPattern |
Yes | Regex pattern to filter SVG files | ^src\/svg\/.*.svg$ |
BlaziconsClassName |
Yes | Name of the generated icon class | MyIcon |
BlaziconsSvgFolderPath |
No | Relative path within the repo to the SVG folder | src/svg |
BlaziconsPropertyNameRemovalPatterns |
No | Semicolon-delimited regex patterns to remove from file names: ^pattern (prefix), pattern$ (suffix), pattern (anywhere) |
^My_Icons_;_24_\w*$;-(original\|plain\|line) |
BlaziconsSkipColorScrub |
No | Skip color scrubbing for SVG content | true |
BlaziconsGeneratedCodeOutputPath |
Yes | Output directory for generated code | Generated |
BlaziconsGeneratorPath |
No | Generator namespace/path structure for the generated file | Blazicons.MyIcons.Generating/Blazicons.MyIcons.Generating.MyIconsGenerator |
BlaziconsPreserveExtractedFiles |
No | Preserve extracted repository files after generation for debugging path issues | true |
* Either BlaziconsRepoUrl or BlaziconsRepoPath must be specified.
Advanced Configuration
Generating Multiple Icon Classes
For cases where multiple icon sets are desired in one package (e.g., different aspect ratios or styles), the recommended approach is to create separate non-packable generator projects that output to your main project.
my-icons/
├─ MyIcons.csproj (main project, packable)
├─ MyIcons.Filled/
│ ├─ MyIcons.Filled.csproj (generator project, non-packable)
├─ MyIcons.Outlined/
│ ├─ MyIcons.Outlined.csproj (generator project, non-packable)
Build-Time Generation Control
Code generation is controlled by the BlaziconsEnableCodeGeneration property, which is automatically set based on configuration file presence. To manually control generation:
<PropertyGroup>
<BlaziconsEnableCodeGeneration>true</BlaziconsEnableCodeGeneration>
</PropertyGroup>
Debugging Path Issues
When experiencing "SVG folder not found" errors, use the BlaziconsPreserveExtractedFiles property to preserve temporary files for inspection:
<PropertyGroup>
<BlaziconsPreserveExtractedFiles>true</BlaziconsPreserveExtractedFiles>
</PropertyGroup>
Build the project and check the build output for the message "Extracted files preserved at: [path]". You can then navigate to that directory to verify the folder structure and determine the correct BlaziconsSvgFolderPath value. Remember to set this property back to false for production builds.
Troubleshooting
Code not generating
- Ensure
BlaziconsEnableCodeGenerationis set totrue - Verify all required properties are configured
- Check that the
BlaziconsRepoUrlorBlaziconsRepoPathis valid and accessible - Review build output for error messages from the generator
SVG folder not found
- Use
BlaziconsPreserveExtractedFilesset totrueto keep temporary extracted files - Check the build output for the "Extracted files preserved at" message
- Navigate to that directory to verify the actual folder structure
- Adjust
BlaziconsSvgFolderPathto match the relative path from the extracted files root - Remember to set
BlaziconsPreserveExtractedFilesback tofalsefor normal use
Build errors after generation
- Clean the solution and rebuild
- Verify the generated code is in the expected output directory
- Ensure the target frameworks match your project requirements
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- CodeCasing (>= 4.0.5)
- HtmlAgilityPack (>= 1.12.4)
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 |
|---|---|---|
| 3.3.35 | 90 | 3/15/2026 |
| 3.3.35-beta | 74 | 3/15/2026 |
| 3.3.34-alpha | 76 | 3/15/2026 |
| 3.3.32-alpha | 76 | 2/28/2026 |
| 3.3.31-alpha | 78 | 2/28/2026 |
| 3.3.30-alpha | 78 | 2/28/2026 |
| 3.2.28 | 117 | 2/23/2026 |
| 3.2.28-beta | 81 | 2/23/2026 |
| 3.2.27-alpha | 83 | 2/21/2026 |
| 3.2.26-alpha | 86 | 2/21/2026 |
| 3.2.25-alpha | 82 | 2/21/2026 |
| 3.2.22-alpha | 83 | 2/21/2026 |
| 3.1.19 | 93 | 2/20/2026 |
| 3.1.19-beta | 77 | 2/20/2026 |
| 3.1.17-alpha | 86 | 2/20/2026 |
| 3.1.16-alpha | 87 | 2/19/2026 |
| 3.1.15-alpha | 80 | 2/19/2026 |
| 3.1.14-alpha | 85 | 2/19/2026 |
| 3.1.11-alpha | 85 | 2/18/2026 |
| 3.0.8-beta | 79 | 2/17/2026 |