You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CI build was failing with compile errors caused by Dynamo API members that are not available in all targeted versions.
Changes
FocaModel.cs — CoreNodeModels.Input.CustomSelection was added in Dynamo 2.16. Wrapped the customSelectionOption block with #if D216_OR_GREATER to exclude it from earlier targets.
NodeSwapperViewModel.cs — NodeViewModel.OriginalName was added in Dynamo 2.6. The #if !D30_OR_GREATER branch used OriginalName unconditionally. Refactored to a three-way conditional matching the existing pattern in FocaModel.cs:
Globals.cs, MonocleViewExtension.cs, PackageUsageModel.cs — PackageManagerExtension (from DynamoPackages.dll) is only distributed via NuGet starting with Dynamo 2.19. For earlier versions it was only available from a local Revit installation, which does not exist in CI. Changed all #if D25_OR_GREATER guards around PackageManagerExtension usage to #if D219_OR_GREATER.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@copilot this fix might need to cover more 2.x versions. I'm not sure when the package manager methods were added
Fixed in commit 2c921b3. PackageManagerExtension lives in DynamoPackages.dll, which is only available via NuGet in dynamovisualprogramming.core 2.19 and later. For versions 2.5–2.18 it was only in a Revit-specific local installation (the hardcoded HintPath to C:\Program Files\Autodesk\Revit 2022\AddIns\DynamoForRevit\DynamoPackages.dll), so it can't compile in CI. Changed all three #if D25_OR_GREATER guards around PackageManagerExtension usage (Globals.cs, MonocleViewExtension.cs, PackageUsageModel.cs) to #if D219_OR_GREATER. All 13 net48 configurations now build with 0 errors.
CopilotAI
changed the title
Fix compile errors for Dynamo 2.0 build target
Fix compile errors across multiple Dynamo build targets
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI build was failing with compile errors caused by Dynamo API members that are not available in all targeted versions.
Changes
FocaModel.cs—CoreNodeModels.Input.CustomSelectionwas added in Dynamo 2.16. Wrapped thecustomSelectionOptionblock with#if D216_OR_GREATERto exclude it from earlier targets.NodeSwapperViewModel.cs—NodeViewModel.OriginalNamewas added in Dynamo 2.6. The#if !D30_OR_GREATERbranch usedOriginalNameunconditionally. Refactored to a three-way conditional matching the existing pattern inFocaModel.cs:Globals.cs,MonocleViewExtension.cs,PackageUsageModel.cs—PackageManagerExtension(fromDynamoPackages.dll) is only distributed via NuGet starting with Dynamo 2.19. For earlier versions it was only available from a local Revit installation, which does not exist in CI. Changed all#if D25_OR_GREATERguards aroundPackageManagerExtensionusage to#if D219_OR_GREATER.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.