Base16.Svg.BuildTasks 1.0.0

Install-Package Base16.Svg.BuildTasks -Version 1.0.0
dotnet add package Base16.Svg.BuildTasks --version 1.0.0
<PackageReference Include="Base16.Svg.BuildTasks" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Base16.Svg.BuildTasks --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Base16.Svg.BuildTasks, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Base16.Svg.BuildTasks as a Cake Addin
#addin nuget:?package=Base16.Svg.BuildTasks&version=1.0.0

// Install Base16.Svg.BuildTasks as a Cake Tool
#tool nuget:?package=Base16.Svg.BuildTasks&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


This package adds a custom build task that generates DrawingVisuals from SVG-files (Scalable Vector Graphics) which can then be directly used and referenced in WPF (Windows Presentation Foundation) applications.

This simplifies the process of creating a scalable UI using SVGs.

By adding a reference to this package all SVG-files in the referencing project will get a DrawingVisual generated with the same name as the SVG-file and a namespace that corresponds to the files location in the project structure.

Since this approach uses code-generation no additional runtime dependencies are required.

Getting Started

  1. Create a new WPF application and call it WpfSvgTestApp using either .NET Core or .NET Framework
  2. Add a reference to this NuGet-package
  3. Create a new folder in your project called Svg
  4. Add any SVG-file that you might have to the Svg folder (see known issues) and name the file MySvg.svg
  5. Verify that Build Action for the SVG-file is set to Svg Visual/SvgVisual
  6. Open MainWindow.xaml and replace the content with the following
<Window x:Class="WpfSvgTestApp.MainWindow"
        Title="MainWindow" Height="450" Width="800">
            <VisualBrush Stretch="Uniform">
                    <Svg:MySvg />

  1. Compile and run the application

Known issues

  • If Svg Visual/SvgVisual is not available as Build Action after first adding this package simple unload and reload the project/solution
  • Symbols are currently not handled - only the "root visual" will get processed - this might change
  • "CSS type styles" are not handled
  • "Advanced masks" are not handled
  • Filenames are not mangled/normalized/cleaned - the name of the file will be used as the name of the generated DrawingVisual (excluding extension)
  • ...

Change log

Version 1.0.0

Initial release.

  • .NETFramework 4.7.1

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

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.0 379 2/2/2020