Fix automation tab assembly loading in published builds #3

Merged
doug merged 1 commit from bug/automation into main 2026-01-21 09:43:20 -05:00
Owner

What does this pull request do?

The recently added automation tab can't compile C# on published builds. It's a problem with the way it loads assemblies in single-file apps, where there are no DLLs on the filesystem beside the exe, so we extract them from the running executable.

Compilation errors:
  Line -14: The type or namespace name 'DateTime' does not exist in the namespace 'System' (are you missing an assembly reference?)
  Line -18: The type or namespace name 'Collections' does not exist in the namespace 'System' (are you missing an assembly reference?)
  Line -17: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
  Line -10: Predefined type 'System.Object' is not defined or imported
  Line -8: Predefined type 'System.Object' is not defined or imported
  Line -8: Predefined type 'System.Object' is not defined or imported
  Line -8: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)

In single-file published builds, TRUSTED_PLATFORM_ASSEMBLIES paths may
not exist or be accessible. Changed GetMetadataReferences to use
AppDomain.CurrentDomain.GetAssemblies() and the existing TryGetRawMetadata
approach that already handles single-file scenarios correctly.

How is it tested?

Manually on published macos build

## What does this pull request do? The recently added automation tab can't compile C# on published builds. It's a problem with the way it loads assemblies in single-file apps, where there are no DLLs on the filesystem beside the exe, so we extract them from the running executable. ``` Compilation errors: Line -14: The type or namespace name 'DateTime' does not exist in the namespace 'System' (are you missing an assembly reference?) Line -18: The type or namespace name 'Collections' does not exist in the namespace 'System' (are you missing an assembly reference?) Line -17: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) Line -10: Predefined type 'System.Object' is not defined or imported Line -8: Predefined type 'System.Object' is not defined or imported Line -8: Predefined type 'System.Object' is not defined or imported Line -8: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?) ``` In single-file published builds, `TRUSTED_PLATFORM_ASSEMBLIES` paths may not exist or be accessible. Changed `GetMetadataReferences` to use `AppDomain.CurrentDomain.GetAssemblies()` and the existing `TryGetRawMetadata` approach that already handles single-file scenarios correctly. ## How is it tested? Manually on published macos build
Fix automation tab assembly loading in published builds
All checks were successful
Build for Windows / Windows Installer (pull_request) Successful in 3m59s
Build for Linux / Build for Linux (pull_request) Successful in 4m0s
Build for macOS / macOS Installer (pull_request) Successful in 7m32s
b9299929b6
In single-file published builds, TRUSTED_PLATFORM_ASSEMBLIES paths may
not exist or be accessible. Changed GetMetadataReferences to use
AppDomain.CurrentDomain.GetAssemblies() and the existing TryGetRawMetadata
approach that already handles single-file scenarios correctly.
doug merged commit 74b5d069ad into main 2026-01-21 09:43:20 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
doug/FitEdit!3
No description provided.