Skip to content

WIP net10.0 Update #15933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

saintentropy
Copy link
Contributor

@saintentropy saintentropy commented Mar 17, 2025

Purpose

WIP. The purpose of this PR is to update the Dynamo Repo from net8.0 to net10.0. The changes include:

  • Updating the build and test to utilize net10.0
  • Update the ambiguous reference to MenuItem
  • Remove use of embedded node bitmap icons in various Image.resx files. These embedded images utilized the BinaryFormatter for serialization. The BinaryFormatter is no longer included with net10.0 and attempts to deserialize the existing icons result in an exception. This PR has updated the icon images to be included by runtime serialization to embedded resource in byte[] format. Due to the runtime serialization, the individual images files are now included explicitly in the repo.

Todo

  • Audit and remove extraneous images. Some icons are either no longer required (ie nodes that have been removed, renamed, or deprecated)
  • Adjust Build system to support net10.0 builds.
  • Identify options for third party node developers. This may be messaging and documentation to indicate lack of support of previous embed bitmap icons.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

  • Dynamo is now built with the .NET10.0 Runtime
  • Dynamo mechanism for icon packages is now updated due to changes in .NET10 Runtime. Embedded Bitmap icons in a .resx file are no longer supported. The prefered option is embedded Byte[]

Reviewers

@zeusongit @sm6srw @aparajit-pratap

FYIs

@Amoursol @achintyabhat @jasonstratton

}
catch(Exception e)
{
//log the error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where we can support some logging or alternative loading option for legacy packages

}
byte[] imageBytes = rm.GetObject(icon.Name) as byte[];
string base64String = Convert.ToBase64String(imageBytes);
return base64String;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change here is actually an optimization. Currently the exception for casting to Bitmap is caught outside of this function. Maybe we also do something here?

@saintentropy saintentropy changed the title Net10 update WIP net10.0 Update Mar 18, 2025
@QilongTang QilongTang requested a review from Copilot May 30, 2025 15:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Dynamo repo to target net10.0, addressing runtime serialization changes and resolving ambiguous references in menu item code. Key changes include:

  • Updating MenuItem type references to use System.Windows.Controls.MenuItem for clarity.
  • Refactoring icon loading logic to use embedded resource byte[] with runtime deserialization.
  • Upgrading build configurations and workflows from net8.0 to net10.0.

Reviewed Changes

Copilot reviewed 2289 out of 2289 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs Updated MenuItem references for explicit namespace qualification.
src/DynamoCoreWpf/Services/IconServices.cs Modified icon loading to use MemoryStream and runtime deserialization.
src/Config/CS_SDK.props Updated target framework from net8.0 to net10.0.
.github/workflows/issue_type_predicter.yml Updated dotnet restore/cp commands for net10.0 builds.
.github/workflows/dynamo_bin_diff.yml Updated msbuild commands to target net10.0.

}
catch(Exception e)
{
//log the error
Copy link
Preview

Copilot AI May 30, 2025

Choose a reason for hiding this comment

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

Consider logging the exception details within the catch block instead of silently swallowing the error, to facilitate easier debugging in production.

Suggested change
//log the error
System.Diagnostics.Debug.WriteLine($"Error loading icon '{iconKey}': {e.Message}\n{e.StackTrace}");

Copilot uses AI. Check for mistakes.

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.

1 participant