DYN-10098 Backport .NET 10 framework migration to legacy 3.6.2 branch#16863
DYN-10098 Backport .NET 10 framework migration to legacy 3.6.2 branch#16863Copilot wants to merge 12 commits intoRC3.6.2_masterfrom
Conversation
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9196
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9196
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10098
| @@ -240,6 +240,23 @@ internal static string ToLiteral(string input) | |||
There was a problem hiding this comment.
The current implementation uses CodeDom with special handling for .NET 10's concatenated string format (added in commit 1d33469 from PR #16478).
I wasn't able to locate PR #16501 in the repository history. Could you share more details about the DS-specific escaper approach mentioned in that PR? If there's a better solution that replaces CodeDom entirely, I'd be happy to incorporate it.
The current workaround handles the new string concatenation behavior in .NET 10, but if there's a more robust alternative, that would be preferable.
There was a problem hiding this comment.
@copilot, the DS escaper solution implemented in #16501 is as follows:
/// <summary>
/// Escapes a string for use in DesignScript string literals.
/// Uses the same escaping logic as the Parser's GetEscapedString but in reverse,
/// ensuring perfect round-trip compatibility with the DesignScript parser.
/// Handles all standard escape sequences: \\, \", \a, \b, \f, \n, \r, \t, \v, \0
/// Returns the escaped content without surrounding quotes.
/// </summary>
/// <param name="input">The string to escape</param>
/// <returns>The escaped string suitable for DesignScript string literals</returns>
internal static string ToLiteral(string input)
{
if (input == null)
return string.Empty;
// Fast path: check if string needs escaping
var needsEscape = false;
for (int i = 0; i < input.Length; i++)
{
char c = input[i];
if (c == '\\' || c == '"' || c == '\a' || c == '\b' || c == '\f' ||
c == '\n' || c == '\r' || c == '\t' || c == '\v' || c == '\0')
{
needsEscape = true;
break;
}
}
if (!needsEscape)
return input;
// Slow path: escape the characters that need escaping
var sb = new System.Text.StringBuilder(input.Length + 8);
for (int i = 0; i < input.Length; i++)
{
char c = input[i];
switch (c)
{
case '\\':
sb.Append("\\\\"); // backslash
break;
case '"':
sb.Append("\\\""); // quote
break;
case '\a':
sb.Append("\\a"); // alert
break;
case '\b':
sb.Append("\\b"); // backspace
break;
case '\f':
sb.Append("\\f"); // form feed
break;
case '\n':
sb.Append("\\n"); // newline
break;
case '\r':
sb.Append("\\r"); // carriage return
break;
case '\t':
sb.Append("\\t"); // tab
break;
case '\v':
sb.Append("\\v"); // vertical tab
break;
case '\0':
sb.Append("\\0"); // null character
break;
default:
sb.Append(c); // Unicode and all other characters go through as-is
break;
}
}
return sb.ToString();
}
@copilot, is this better?
src/Resources/DynamoWatch3D/LargeIcons/Dynamo.Nodes.Watch3D.Large.png
Outdated
Show resolved
Hide resolved
|
Only one reported regression from https://master-15.jenkins.autodesk.com/view/DYN/job/DYN-Dynamo/job/DynamoBuildscripts/job/RC3.6.x_master/5/, then I found Copilot missed cherry-picking #16521. Done in the latest commit |
|
@DynamoDS/eidos This PR is ready for a final review. See PR description for all cherry-picked PRs |
|



Backports .NET 10 framework support from RC4.0.x branches. Migrates from .NET 8.0 → .NET 10.0.100 (LTS, final release). Framework changes only—PythonNet3 features excluded.
Cherry-picked commits
fb1f8a33d777883d1dee891a9e688e452822f9f9f318c0c8a2422224ec5bbf8d4f15cbScope
Included: Framework migration, build infrastructure, multi-targeting, resource regeneration, path fixes
Excluded: PythonNet3 changes from
f30eda3d(engine updates, library changes, UI features)Key changes
src/Config/CS_SDK.props: net8.0 → net10.0global.json: SDK 10.0.100, rollForward: latestFeature.github/workflows/*.yml→ dotnet-version: 10.0.xsrc/NodeServices/DynamoServices.csproj: Multi-target net8.0 + net10.0README.md: Build requirements updatedBuild requirements
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.