Skip to content

Fix runtime path resolution when launched outside the working directory - #77

Open
judenimo wants to merge 33 commits into
StarMapLoader:feature/external/pr-77-mainfrom
judenimo:main
Open

Fix runtime path resolution when launched outside the working directory#77
judenimo wants to merge 33 commits into
StarMapLoader:feature/external/pr-77-mainfrom
judenimo:main

Conversation

@judenimo

Copy link
Copy Markdown

Summary

Fixes an issue where StarMap fails to start when launched from a directory other than the repository or application directory.

Problem

Several runtime files were resolved using paths relative to the process's current working directory. This caused StarMap to search for assemblies and configuration files in whichever directory the command was run from.

For example, running dotnet run --project ... from the user's home directory caused StarMap to look there for 0Harmony.dll, StarMap.Core.dll, and StarMapConfig.json.

Changes

  • Resolves 0Harmony.dll relative to AppContext.BaseDirectory in both solo and loader modes.
  • Resolves StarMap.Core.dll relative to the application directory.
  • Uses StarMap.Loader.dll as the AssemblyDependencyResolver component path.
  • Locates the repository configuration during development by searching upwards for StarMap.slnx.
  • Falls back to locating StarMapConfig.json beside the executable in installed and release builds.

Verification

  • Confirmed that the solution builds successfully.
  • Confirmed that solo mode works when launched from the repository directory.
  • Confirmed that StarMap can be launched using an absolute project path from a different working directory.
  • Confirmed that the main development StarMapConfig.json is located correctly.

KlaasWhite and others added 30 commits November 15, 2025 19:43
Mods can implement the IStarMapOnUi to access OnBeforeUi and OnAfterUi which are called before and after the OnDrawUi of Program in KSA, this can be used to add or overwrite ui elements using ImGui
Only publish API when there is a change
Switch interface to use attributes instead of interfaces
Resolve issue in attribute resolution
Fixed issue with StarMap.API forcing dummy KSA dll
StarMapBeforeMainAttribute attribute + Fix issue with ALCs unloading after initialization
Change actions to publish StarMap.API to nuget instead of github
Make the AssemblyLoadContexts not collectable (StarMapLoader#42)
Do not try to unload the assembly load contexts (StarMapLoader#44)
Add StarMap hook for after onFrame
Feature/external/pr 65 fix local mods folder dev (StarMapLoader#69)
Fix OnDrawUi harmony patch for KSA 2026.4.6.4036 (StarMapLoader#71)
Add config option for game CLI arguments
@github-actions
github-actions Bot changed the base branch from main to feature/external/pr-77-main July 16, 2026 07:25
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