Closed Basewq closed 5 months ago
Use PlatformFolders.ApplicationExecutablePath instead of Assembly.GetEntryAssembly().Location
PlatformFolders.ApplicationExecutablePath
Assembly.GetEntryAssembly().Location
https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#api-incompatibility Under 'API incompatibility' Assembly.Location is not available with single file deployment. https://learn.microsoft.com/en-us/dotnet/api/system.environment.processpath?view=net-8.0 Environment.ProcessPath can be used as a fallback, but do note that even that can return null.
Assembly.Location
Environment.ProcessPath
Fixes #2304 where Icon is set via GameContext.ProductLocation
GameContext.ProductLocation
Also fixes the super secret LeftCtrl + C+ F1 screenshot command in PublishSingleFile.
Thanks !
PR Details
Use
PlatformFolders.ApplicationExecutablePath
instead ofAssembly.GetEntryAssembly().Location
https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#api-incompatibility Under 'API incompatibility'
Assembly.Location
is not available with single file deployment. https://learn.microsoft.com/en-us/dotnet/api/system.environment.processpath?view=net-8.0Environment.ProcessPath
can be used as a fallback, but do note that even that can return null.Related Issue
Fixes #2304 where Icon is set via
GameContext.ProductLocation
Also fixes the super secret LeftCtrl + C+ F1 screenshot command in PublishSingleFile.
Types of changes
Checklist