Skip to content

Migrate DynamoText from .NET Framework 4.5 to .NET 8 #10

@johnpierson

Description

@johnpierson

Background

DynamoText currently targets net45, which has been EOL since 2016. The project uses a Visual Studio 2012 legacy .csproj format with packages.config. This issue tracks a full migration to .NET 8 and SDK-style project format so the package can build against modern Dynamo SDK versions and run on current .NET runtimes.

This issue is assigned to an AI coding agent. Every step below is meant to be executed directly — no design decisions left open.


Files to touch

File Action
DynamoText.csproj Full rewrite to SDK-style
packages.config Delete after migration
Properties/AssemblyInfo.cs Delete after absorbing attributes into .csproj
All .cs files using FormattedText Fix constructor signature if needed
.github/workflows/build.yml Create new file

Checklist

1. Convert DynamoText.csproj to SDK-style

  • Replace the entire file with a <Project Sdk="Microsoft.NET.Sdk"> SDK-style project.
  • Set <TargetFramework>net8.0-windows</TargetFramework>. The -windows suffix is required — this project uses WPF types (FormattedText, FontFamily, Typeface, GlyphTypeface) that are Windows-only.
  • Set <UseWpf>true</UseWpf> so the SDK includes WPF references automatically. Remove any manual <Reference> entries for PresentationCore, PresentationFramework, and WindowsBase — they are covered by UseWpf.
  • Set <Nullable>enable</Nullable> and <ImplicitUsings>disable</ImplicitUsings>.
  • Set <AssemblyName>, <RootNamespace>, and <Platforms>x64</Platforms> to match current values.

2. Migrate NuGet references from packages.config to PackageReference

  • Find the latest versions of DynamoVisualProgramming.DynamoServices and DynamoVisualProgramming.ZeroTouchLibrary on NuGet that target net8.0 or net8.0-windows. Use those versions.
  • Add them as <PackageReference> items in the new .csproj.
  • Delete packages.config and the packages/ directory if it exists.

3. Absorb Properties/AssemblyInfo.cs into .csproj

  • Move AssemblyTitle, AssemblyDescription, AssemblyCompany, AssemblyProduct, AssemblyCopyright, AssemblyVersion, and AssemblyFileVersion into .csproj metadata elements.
  • Delete Properties/AssemblyInfo.cs. If Properties/ becomes empty, delete the directory too.

4. Fix FormattedText constructor calls

The FormattedText constructor signature changed between .NET Framework and .NET Core/5+. Several overloads now require a numberSubstitution parameter that was absent before.

  • Search all .cs files for new FormattedText( and inspect every call site.
  • If any call is missing the numberSubstitution argument, pass new NumberSubstitution(). Also add pixelsPerDip (use 1.0 if no Visual source is available):
new FormattedText(
    textToFormat,
    cultureInfo,
    flowDirection,
    typeface,
    emSize,
    foreground,
    new NumberSubstitution(),  // add if missing
    1.0                        // pixelsPerDip — add if missing
)
  • Add any needed using statements (System.Windows.Media, System.Globalization).
  • Do not change logic — only fix constructor call signatures to compile cleanly.

5. Add a GitHub Actions CI workflow

Create .github/workflows/build.yml:

  • Trigger on push and pull_request to main.
  • Run on windows-latest (required for net8.0-windows).
  • Steps: checkout → actions/setup-dotnet@v4 with dotnet-version: '8.0.x'dotnet restoredotnet build --no-restore --configuration Release.

6. Verify the build

  • dotnet build --configuration Release must exit with code 0, zero errors.
  • Do not suppress warnings with #pragma unless there is no cleaner fix.

Definition of done

  • DynamoText.csproj is SDK-style, targets net8.0-windows, uses <UseWpf>true</UseWpf>
  • packages.config deleted
  • Properties/AssemblyInfo.cs deleted; metadata lives in .csproj
  • DynamoVisualProgramming.* packages updated to latest net8-compatible versions
  • All FormattedText constructor calls compile without error on .NET 8
  • .github/workflows/build.yml exists and build step passes on windows-latest
  • dotnet build --configuration Release exits with code 0

Notes

  • Do not add a test project as part of this PR — tracked separately.
  • Keep the public API surface identical. This is a build infrastructure change, not a refactor.
  • If the DynamoVisualProgramming packages don't yet publish net8 TFM targets and only ship net48 or netstandard2.0, use the best available version and document the TFM mismatch as a comment in the .csproj.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions