Skip to content

DYN-10381 - Migrate DynamoText from .NET Framework 4.5 to .NET 8#11

Merged
johnpierson merged 4 commits into
masterfrom
claude/migrate-dynamotext-to-net8
Apr 9, 2026
Merged

DYN-10381 - Migrate DynamoText from .NET Framework 4.5 to .NET 8#11
johnpierson merged 4 commits into
masterfrom
claude/migrate-dynamotext-to-net8

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 9, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Migrate DynamoText from .NET Framework 4.5 to .NET 8</issue_title>
<issue_description>## 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.</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI linked an issue Apr 9, 2026 that may be closed by this pull request
7 tasks
- Convert DynamoText.csproj to SDK-style targeting net8.0-windows
- Migrate NuGet packages to PackageReference (DynamoServices 3.2.2.5494, ZeroTouchLibrary 3.1.0.4724)
- Delete packages.config and Properties/AssemblyInfo.cs
- Fix FormattedText constructor for .NET 8 (add NumberSubstitution and pixelsPerDip parameters)
- Add GitHub Actions CI workflow for windows-latest

Agent-Logs-Url: https://github.com/DynamoDS/DynamoText/sessions/17e83894-302a-4ab5-99cf-7ac0f9824b59

Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
@Claude Claude AI requested a review from johnpierson April 9, 2026 19:29
@johnpierson johnpierson changed the title [WIP] Migrate DynamoText from .NET Framework 4.5 to .NET 8 DYN-10381 - Migrate DynamoText from .NET Framework 4.5 to .NET 8 Apr 9, 2026
@johnpierson johnpierson marked this pull request as ready for review April 9, 2026 19:36
@johnpierson
Copy link
Copy Markdown
Member

@claude[agent] - bump the version to 3.0.0 for DynamoText as this will be a large change.

Agent-Logs-Url: https://github.com/DynamoDS/DynamoText/sessions/17d8d9d4-2686-4429-b206-b30be20b046b

Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Apr 9, 2026

@claude[agent] - bump the version to 3.0.0 for DynamoText as this will be a large change.

Updated to version 3.0.0 in df3d201

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10381

@johnpierson
Copy link
Copy Markdown
Member

lookin' good
image

 Reorganize repo to match standard Dynamo package layout: move
  Text.cs, DynamoText.csproj, DynamoText.sln, pkg.json, Example.dyn,
  and DynamoText_DynamoCustomization.xml into src/. Add CreatePackage
  MSBuild target that assembles dist/DynamoText/ (pkg.json + bin/) on
  every build, ready to drop into Dynamo's packages folder. OutputPath
  redirected to repo-root bin/ to keep build artifacts out of src/.
Copy link
Copy Markdown
Member

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@johnpierson johnpierson merged commit bb2eb7d into master Apr 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate DynamoText from .NET Framework 4.5 to .NET 8

2 participants