-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9747: Fix ASC schema detection in Dynamo Revit #16651
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
Conversation
There was a problem hiding this 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-9747
There was a problem hiding this 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 fixes an assembly loading exception in DynamoRevit by checking if DynamoInstallDetective.dll is already loaded before attempting to load it. The issue occurred because DynamoRevit loads this assembly at startup, but DynamoUnits was attempting to load it again, causing version/location conflicts.
- Checks AppDomain for already-loaded
DynamoInstallDetectiveassembly before loading - Falls back to
Assembly.LoadFrom()only when assembly is not already loaded - Maintains backward compatibility with standalone DynamoSandbox scenarios
Given this passed, merging |
(cherry picked from commit 501b338)
|
Successfully created backport PR for |
Purpose
🐛 Bug Fix: Resolves an
Assembly.LoadFromexception when loadingDynamoInstallDetective.dllin DynamoRevit scenarios.Problem: When DynamoUnits attempts to dynamically load
DynamoInstallDetective.dllto discover ASC (Autodesk Single Sign-On Client) unit schema paths, it fails in DynamoRevit with the error:Root Cause: DynamoRevit loads
DynamoInstallDetective.dllat startup, but DynamoUnits was attempting to load it again usingAssembly.LoadFrom(). When .NET detects an assembly with the same name already loaded but with a different version or location, it throws an exception.Solution: Check if
DynamoInstallDetectiveis already loaded in the current AppDomain before attempting to load it. This allows the code to:Declarations
Check these if you believe they are true
Release Notes
Fixed assembly loading exception in DynamoRevit when DynamoUnits attempts to discover ASC unit schema paths. The fix checks if
DynamoInstallDetective.dllis already loaded in the AppDomain before attempting to load it, preventing version conflicts between host applications and the DynamoUnits library.Screenshots
✅ DynamoSandbox - Working
DynamoSandbox successfully loads DynamoInstallDetective.dll from disk and discovers ASC unit schemas
✅ DynamoRevit - Working
DynamoRevit successfully uses the already-loaded DynamoInstallDetective assembly without conflicts
Testing
Reviewers
(FILL ME IN) Reviewer 1
Note to Reviewers: This is a defensive fix that improves robustness when DynamoUnits is used in different host application contexts. The change is backward compatible and doesn't affect the public API.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of