"Cannot be ignored" assembly version error when calling OpenDocumentFile from within a running addin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Revit 2024 addin (IExternalApplication) that opens a second .rvt file in the background using OpenDocumentFile(ModelPath, OpenOptions) from within an IExternalCommand. The addin loads fine on Revit startup and the ribbon appears correctly. However, the moment OpenDocumentFile is called, Revit throws the following error:
Error - cannot be ignored Could not load file or assembly 'xyz, Version=1.0.3.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
My assembly version is 1.0.0.0. There is no 1.0.3.0 anywhere on the machine — not in the GAC, not in Program Files, not in any known location. The .addin manifest in ProgramData points directly to my build output folder.
The error only occurs when OpenDocumentFile is called — not on initial Revit startup. It does not occur if I open the second document manually through the Revit UI.
Questions:
- Does OpenDocumentFile trigger addin re-initialization or assembly resolution against the new document context?
- Is there a known issue with addin assembly resolution when opening background documents from within a running addin?
- Is there a recommended pattern for opening a second document in the background from an IExternalCommand that avoids this?
Any guidance appreciated.