For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrating node icons to .NET 10

Overview

Dynamo 4.0 runs on .NET 10. If your package includes node icons, you may need to update how those icons are stored. Packages that still use the old icon format may fail to build, or icons may not appear in the node library.

This guide explains what changed, why, and how to update your package.

Why icons broke

Node icons in Dynamo packages are stored in a *Images.resx file, compiled into a YourPackage.customization.dll, and loaded at runtime by Dynamo.

Historically, many packages embedded icons as System.Drawing.Bitmap objects inside the .resx file. That format relies on BinaryFormatter for serialization. BinaryFormatter was removed in .NET 10, so:

  • Build time: GenerateResource may fail when processing old .resx entries.

  • Runtime: ResourceManager.GetObject() may throw when Dynamo tries to load icons.

Dynamo's built-in libraries were migrated in #16478 by avoiding BinaryFormatter entirely — icons are now stored as raw PNG byte[] data via ResXFileRef, not as serialized Bitmap objects.

There is no drop-in BinaryFormatter replacement. The supported approach is to migrate your icon resources to the new format.

Who needs to act

You need to migrate if your package:

  • Targets Dynamo 4.0 / .NET 10, and

  • Has a YourPackageImages.resx (or similar) with entries like:

You do not need to change:

  • String localization .resx files (Properties/Resources.resx) — these are unaffected.

  • Packages with no node icons.

  • The overall *.customization.dll pipeline — only the content format inside the .resx changes.

How Dynamo loads icons (unchanged)

The loading pipeline is the same as before:

  1. Your node library builds YourPackage.dll.

  2. A post-build step compiles YourPackageImages.resxYourPackage.customization.dll.

  3. Both DLLs are placed in package/bin/.

  4. Dynamo loads icons via ResourceManager("{AssemblyName}Images", customizationAssembly).

What changed is the type of data stored in the resource assembly: byte[] (PNG bytes) instead of serialized Bitmap.


Migration steps

1. Extract icons as PNG files

For each embedded icon in your .resx, save it as a standalone .png file. A typical layout:

Naming rules:

  • Each node needs a Small and Large icon.

  • Resource keys use the format {FullyQualifiedNodeName}.Small and {FullyQualifiedNodeName}.Large.

  • Match the fully qualified type name Dynamo uses for the node (e.g. MyCompany.MyPackage.Nodes.MyNode).

  • Use exact case in file names and .resx paths — Linux builds are case-sensitive.

2. Update the .resx file

Replace embedded Bitmap entries with ResXFileRef entries pointing at your PNG files.

Before (does not work on .NET 10):

After (.NET 10 compatible):

Tip: In Visual Studio, open MyPackageImages.resx, remove the old embedded images, then drag PNG files into the resource editor. VS generates the ResXFileRef entries automatically.

3. Confirm the build target (.csproj)

The customization DLL build step is unchanged. Ensure your .csproj still contains something like:

Also update your target framework:

4. Update custom icon-loading code (if any)

Most packages rely on Dynamo's built-in icon loading and need no code changes. If your package loads icons directly from a ResourceManager, update the deserialization.

Before:

After:

For base64 encoding (e.g. a web-based library view):

This matches how Dynamo loads icons internally as of #16478.

5. Rebuild and verify

  1. Rebuild the package on the .NET 10 SDK.

  2. Confirm MyPackage.customization.dll is produced in bin/.

  3. Install the package in Dynamo 4.0 Sandbox.

  4. Check that icons appear in the library for all nodes.

  5. If you support cross-platform builds, verify PNG file names match .resx paths exactly (case-sensitive).


Complete minimal example

Project layout:

SamplePackageImages.resx (excerpt):

SamplePackage.csproj (excerpt):

Published package layout:


Troubleshooting

Symptom
Likely cause
Fix

Build fails on GenerateResource

Old embedded Bitmap entries remain

Convert all icon entries to ResXFileRef

Icons missing at runtime, no build error

Stale customization.dll from pre-migration build

Clean and rebuild; republish package

Icons work on Windows, fail on Linux CI

Case mismatch between .resx path and PNG file name

Align casing exactly

InvalidCastException on GetObject()

Code still casts to Bitmap

Read byte[] and construct Bitmap from MemoryStream

Wrong / default icon shown

Resource key doesn't match node name

Use fully qualified node name + .Small/.Large suffix

What not to do

  • Do not try to re-enable BinaryFormatter — it is removed in .NET 10 by design.

  • Do not embed new icons as System.Drawing.Bitmap in .resx files.

  • Do not omit the customization.dll from the published bin/ folder.

References

Last updated