Obsidian
Obsidian copied to clipboard
Invalid executable path under certain conditions
Using Assembly.Get***Assembly().Location
will return an empty value when the project is packed into a single file executable.
https://github.com/ObsidianMC/Obsidian/blob/9ff5df4421ef319753d3cd7a8335f104bb8276bd/Obsidian/Program.cs#L32
The way to prevent this is to use AppContext.BaseDirectory
which will return a valid path under all conditions.
We should make sure that we don't use APIs incompatible with single file builds.
We shouldn't query for binary locations, especially considering Linux conventions where programs are in a read-only binary directory, instead we should use the working directory like every other program.
Closing this as its been fixed.