Skip to content

Core: Use correct method for locating Plugin assemblies - #174

Open
Arcitec wants to merge 1 commit into
atom0s:masterfrom
Arcitec:fix-app-configs
Open

Arcitec wants to merge 1 commit into
atom0s:masterfrom
Arcitec:fix-app-configs

Conversation

@Arcitec

@Arcitec Arcitec commented Sep 11, 2026

Copy link
Copy Markdown

The previous attempt at fixing this was incomplete and hacky (and doesn't work at all when run via Wine on Linux):

c2719b7

By default, the .NET runtime (on both Windows and Linux) only looks for libraries in the application's current folder or the Global Assembly Cache (GAC). In other words, plugins (custom assemblies) would have to be in the same directory as the EXE file, or in the global system location.

To allow applications to place assemblies anywhere, the specification says that we must extend the assembly probing path via the application configuration:

https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/probing-element

"runtime: Contains information about assembly binding and garbage collection."

"probing: Specifies application base subdirectories for the common language runtime to search when loading assemblies."

"privatePath: Specifies subdirectories of the application's base directory that might contain assemblies. Delimit each subdirectory with a semicolon."

The correct method has now been applied to the app configurations, which makes Steamless work on Linux too, and improves the assembly loading on Windows. In fact, you can remove most of your custom assembly loading code from the older commit (you don't need the "Plugins" dir overriding anymore, and only need the "embedded plugins" detection code).

Hopefully this can make it into a quick release to fix this issue for everyone.

PS: This assembly loading path specification fix doesn't require any actual code changes, in case you don't want to spend time cleaning up/removing the old hack. 😸

Closes #75

@Arcitec

Arcitec commented Sep 11, 2026

Copy link
Copy Markdown
Author

To be clear, this fix is necessary and solves the following bug (which has been discussed in previous tickets):

$ wine Steamless.CLI.exe

Unhandled Exception:
System.TypeLoadException: Could not load type of field 'Steamless.CLI.Program+<>c:<>9__3_0' (2) due to: Could not load file or assembly 'Steamless.API, Version=1.0.0.8, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

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.

Steamless.API.dll is still required to be in the same folder as the CLI executable after c2719b776d77ed2855443067d9c1c127a4fdc935

1 participant