How to Run Aspose.SVG for .NET Examples

The official Aspose.SVG for .NET GitHub repository contains runnable C# examples for creating, loading, editing, converting, rendering, and vectorizing SVG content. These are example projects, not XUnit documentation tests.

Download the Examples

Clone the repository:

1git clone https://github.com/aspose-svg/Aspose.SVG-for-.NET.git

Alternatively, download the repository ZIP archive and extract it locally.

The repository currently contains the following useful locations:

LocationWhat it contains
Examples/Aspose.SVG.Examples.CSharp.slnVisual Studio solution for the principal C# examples
Examples/CSharp/CSharp.csprojConsole example project targeting .NET 6.0
Examples/CSharp/RunExamples.csEntry point that selects the examples to execute
Examples/DataInput SVG and other data files used by examples
DocsShort developer-oriented articles included with the repository

Requirements

Before running the examples:

Choose the Examples to Run

The main console project starts in Examples/CSharp/RunExamples.cs. Its Main() method calls examples for conversion, document creation and loading, saving, text vectorization, DOM editing, selectors, XPath, and traversal.

Before running the project, review the calls in Main() and keep enabled only the examples you want to execute. This is especially useful when you want to examine a single conversion result or avoid running samples that require an input, license, or network resource not needed for your task.

Run Using the .NET CLI

From the repository root, build the principal C# example project:

1dotnet build Examples/CSharp/CSharp.csproj

After selecting the calls to execute in RunExamples.cs, run the project:

1dotnet run --project Examples/CSharp/CSharp.csproj

Conversion and save examples write generated files under Examples/output, while their input files are read from Examples/Data.

Run Using Visual Studio

  1. Open Examples/Aspose.SVG.Examples.CSharp.sln in Visual Studio.
  2. Open Examples/CSharp/RunExamples.cs and select the example calls that you want to run.
  3. Build the solution; Visual Studio restores the required NuGet packages.
  4. Run the CSharp console project and inspect generated files in the output directories used by the selected examples.

Explore the Available Examples

The main project includes examples for common Aspose.SVG tasks:

Contribute or Get Help

To add or improve an example, fork the Aspose.SVG for .NET repository, make your change in a branch, and submit a pull request.

For questions about running examples or using the API, visit the Aspose.SVG support forum.

Want to try an SVG task without running C# code? SVG Free Web Applications let you convert, merge, optimize, vectorize, and encode SVG files in a browser.

SVG Free Web Applications

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.