Heroes.XmlData 1.0.2

dotnet add package Heroes.XmlData --version 1.0.2
                    
NuGet\Install-Package Heroes.XmlData -Version 1.0.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="Heroes.XmlData" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Heroes.XmlData" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Heroes.XmlData" />
                    
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 Heroes.XmlData --version 1.0.2
                    
#r "nuget: Heroes.XmlData, 1.0.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 Heroes.XmlData@1.0.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=Heroes.XmlData&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Heroes.XmlData&version=1.0.2
                    
Install as a Cake Tool

Heroes Xml Data

Build Release NuGet

Heroes Xml Data is a .NET library that parses the Heroes of the Storm CASC storage files through the use of CascLib and provides an API to access the files and data.

Usage

Loading Storage

Heroes of the Storm data can be loaded from three sources: a local Heroes of the Storm installation, online, or already extracted data files.

To extract the data files, use a tool such as Heroes Data Parser, CASCExplorer, or CascView.

Example of loading from local installation:

// get the casc configuration, specifying the local storage
CASCConfig cascConfig = HeroesXmlLoader.GetCASCConfig("Path\to\Heroes of the Storm");

// load from the local installation
HeroesXmlLoader heroesXmlLoader = HeroesXmlLoader.LoadWithCASC(cascConfig, new HttpClient());

Example of loading from online:

HttpClient httpClient = new();

// get the casc configuration, specifying online storage
CASCConfig cascConfig = HeroesXmlLoader.GetOnlineCASCConfig(httpClient, isPtr: false);

// load from online
HeroesXmlLoader heroesXmlLoader = HeroesXmlLoader.LoadWithCASC(cascConfig, httpClient);

Example of loading from extracted data files:

// specify the mods root directory
// if on linux or macos, ensure all directories and files are in lowercase characters
HeroesXmlLoader heroesXmlLoader = HeroesXmlLoader.LoadWithFile("Path\to\mods");

There is also an optional ProgressReporter that may be passed in to the LoadWithCASC and LoadWithFile methods:

// optional progress reporting
Progress<ProgressInfo> progress = new(p =>
{
    Console.WriteLine($"Progress: {p.Percentage}% - {p.Message}");
});
ProgressReporter progressReporter = new(progress);

// HeroesXmlLoader.LoadWithCASC(cascConfig, httpClient, progressReporter: progressReporter);
// HeroesXmlLoader.LoadWithFile("Path\to\mods, progressReporter: progressReporter);

HeroesXmlLoader

After loading the storage, the HeroesXmlLoader instance also provides an API to access file-related methods and properties, such as FileExists and GetFile.

string filePath = @"mods\heromods\alarak.stormmod\base.stormdata\gamedata.xml";
bool exists = heroesXmlLoader.FileExists(filePath);
Stream fileStream = heroesXmlLoader.GetFile(filePath);

If the file is an MPQ file, the second argument can be provided to look up an entry:

string filePath = @"mods\core.stormmod\base.stormdata\depotcache\7b\7a\7b7a83395746a818eb7f842a7ff0a27699c93b5a9d170d1c0993a3cc0058e1d0.s2ma";
string mpqEntry = @"enus.stormdata\localizeddata\gamestrings.txt";

bool exists2 = heroesXmlLoader.FileExists(filePath, mpqEntry);
Stream mpqFileStream = heroesXmlLoader.GetFile(filePath, mpqEntry);

Loading StormMods

Use the HeroesXmlLoader instance to load the stormmods. LoadMapMod and LoadGameStrings may be called as many times as needed to switch between different maps and locales.

// loads the base stormmods
heroesXmlLoader.LoadStormMods();

// optionally load a map mod
heroesXmlLoader.LoadMapMod("Warhead Junction");

// optionally load a locale, defaults to enUS
heroesXmlLoader.LoadGameStrings(StormLocale.ENUS);

HeroesData

Get the HeroesData from the HeroesXmlLoader instance. This can be used to obtain data directly from the xml data, gamestrings, layout files, etc.

Visit the wiki for examples.

Developing

To build the code, it is recommended to use the latest version of Visual Studio 2026 or Visual Studio Code.

Another option is to use the dotnet CLI tools from the latest .NET SDK.

License

MIT license

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 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.