Developers with Xbox Game Pass/MS Store game paths that are in a subdirectory of a volume/drive cannot execute NexusMods.App in Debug mode; due to a failed assertion.
Steps to reproduce
Create a MS Store/Gamepass folder in a subfolder of a drive (or extract provided .GamingRoot file to one of your drives).
Run NexusMods.App in Debug Mode.
What is the expected behaviour?
No exception occurs.
Other information
This issue occurs because we convert the path obtained from .GamingRoot file to RelativePath verbatim.
Somewhat recently, we changed the spec and normalized relative paths to use /; and the input path being converted in this case is Games\Xbox. Because the path contains a backslash, assertion fails.
Since those changes were made, the Sanitize method was added; probably just calling that should be sufficient.
Stack Trace:
PathHelpers.IsSanitized() at NexusMods.App\src\NexusMods.Paths\Utilities\PathHelpers.cs:line 98
PathHelpers.DebugAssertIsSanitized() at NexusMods.App\src\NexusMods.Paths\Utilities\PathHelpers.cs:line 71
new RelativePath()
StringExtensions.ToRelativePath()
XboxHandler.ParseGamingRootFile()
XboxHandler.GetAppFolders()
This was caused by a change made to NexusMods.Paths.
With commit dc12a50f98e8ce2bb1f78934abdbed7c6e589339 , it appears that it is now expected that paths call PathHelpers.Sanitize before presenting themselves as RelativePath.
We have 2 options, either update GameFinder to call Sanitize before converting to RelativePath, or make the conversion auto-sanitize.
The former appears to be the 'intended' choice; but that does leave an issue:
How will external libraries (e.g. GameFinder) that can't build against Debug NexusMods.Paths (NuGet Packages are 'release'), know that they'll pass the necessary asserts?
Bug Report
Summary
Developers with Xbox Game Pass/MS Store game paths that are in a subdirectory of a volume/drive cannot execute NexusMods.App in Debug mode; due to a failed assertion.
Steps to reproduce
.GamingRoot
file to one of your drives).NexusMods.App
in Debug Mode.What is the expected behaviour?
No exception occurs.
Other information
This issue occurs because we convert the path obtained from
.GamingRoot
file to RelativePath verbatim.Somewhat recently, we changed the spec and normalized relative paths to use
/
; and the input path being converted in this case isGames\Xbox
. Because the path contains a backslash, assertion fails.Since those changes were made, the
Sanitize
method was added; probably just calling that should be sufficient.Stack Trace:
Example File to Reproduce: GamingRoot.zip
Steps to Resolve
This was caused by a change made to
NexusMods.Paths
.With commit dc12a50f98e8ce2bb1f78934abdbed7c6e589339 , it appears that it is now expected that paths call
PathHelpers.Sanitize
before presenting themselves asRelativePath
.We have 2 options, either update GameFinder to call
Sanitize
before converting toRelativePath
, or make the conversion auto-sanitize.The former appears to be the 'intended' choice; but that does leave an issue:
How will external libraries (e.g. GameFinder) that can't build against Debug NexusMods.Paths (NuGet Packages are 'release'), know that they'll pass the necessary asserts?