Skip to content

Fix compile errors across multiple Dynamo build targets#64

Closed
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-action-step-error
Closed

Fix compile errors across multiple Dynamo build targets#64
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-action-step-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

The CI build was failing with compile errors caused by Dynamo API members that are not available in all targeted versions.

Changes

  • FocaModel.csCoreNodeModels.Input.CustomSelection was added in Dynamo 2.16. Wrapped the customSelectionOption block with #if D216_OR_GREATER to exclude it from earlier targets.

  • NodeSwapperViewModel.csNodeViewModel.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:

#if D30_OR_GREATER
    var nse = ...SearchModel.Entries...s.CreationName.Contains(NodeToSwapTo.OriginalName));
#elif D26_OR_GREATER
    var nse = ...SearchModel.SearchEntries...s.CreationName.Contains(NodeToSwapTo.OriginalName));
#else
    var nse = ...SearchModel.SearchEntries...s.CreationName.Contains(NodeToSwapTo.Name));
#endif
  • Globals.cs, MonocleViewExtension.cs, PackageUsageModel.csPackageManagerExtension (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.
Original prompt

Reference: https://github.com/johnpierson/MonocleForDynamo/actions/runs/23667105775/job/68951700810#step:5:1


💡 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 AI changed the title [WIP] Fix action step error in workflow Fix compile errors for Dynamo 2.0 build target Mar 27, 2026
Copilot AI requested a review from johnpierson March 27, 2026 23:42
@johnpierson
Copy link
Copy Markdown
Owner

@copilot this fix might need to cover more 2.x versions. I'm not sure when the package manager methods were added

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 28, 2026

@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.

Copilot AI changed the title Fix compile errors for Dynamo 2.0 build target Fix compile errors across multiple Dynamo build targets Mar 28, 2026
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.

2 participants