Repository navigation
development
-
Install the .NET 10 SDK (the repository pins
10.0.301inglobal.json). -
Clone the repository and build:
dotnet build CSharp_CHDMounter.sln dotnet test CHDMounter.Tests/CHDMounter.Tests.csproj -
Run the application:
dotnet run --project CHDMounter/CHDMounter.csproj
See Building from Source for publishing and release packaging.
| Path | Contents |
|---|---|
CHDMounter/ |
Cross-platform Avalonia application |
CHDMounter/Interfaces/ |
Service contracts |
CHDMounter/Models/ |
Settings, log entry, mount backend, update result |
CHDMounter/Services/ |
Logging, settings, mounting, screenshots, stats, updates, bug reports |
CHDMounter/Mounting/ |
Mount router, Dokan/WinFsp/FUSE backends, shared path helper |
CHDMounter/Views/ |
Windows, dialogs and code-behind |
CHDMounter.Tests/ |
xUnit unit and integration tests |
CHDMounter_Tester/ |
WPF batch-parsing/benchmarking tool (developer only) |
build/ |
Release packaging script |
docs/ |
This documentation (docfx + GitHub wiki source) |
-
Nullable reference types are enabled everywhere; avoid
!unless the invariant is obvious and commented. -
Implicit usings are enabled; shared global usings live in
GlobalUsings.cs. -
XML documentation is enforced for public API (
GenerateDocumentationFile); the solution must build with zero warnings. Document internal helpers too. -
Async naming — every asynchronous method ends with
Async, including event handlers. -
Logging goes through Serilog. Never use
Console.WriteLine/Debug.WriteLinefor diagnostics; useILoggingService(UI + Serilog) orSerilog.Logdirectly. -
User/environment errors are logged with
LoggingService.LogUserError(Information level) so they never file bug reports; genuine failures useLogErrorwith the exception. -
Analyzers —
Meziantou.Analyzerruns on all projects; keep the build warning-free. -
Visibility — implementation classes are
internal; only contracts and types needed by the Tester or tests arepublic(tests and the Tester useInternalsVisibleTo). - Catch blocks always log; silent catches are only allowed for documented last-resort paths.
The test project uses xUnit and contains both unit tests and integration tests:
# All tests
dotnet test CHDMounter.Tests/CHDMounter.Tests.csproj
# A single class
dotnet test CHDMounter.Tests/CHDMounter.Tests.csproj --filter "FullyQualifiedName~MountPathHelperTests"
# By namespace
dotnet test CHDMounter.Tests/CHDMounter.Tests.csproj --filter "FullyQualifiedName~CHDMounter.Tests.Services"-
Integration tests (
CHDMounter.Tests/Parsers) parse real CHD files. They read paths fromChdPathCatalog; directories that do not exist on the machine are skipped, so the suite passes on machines without the game library. -
Unit tests must not send real bug reports —
TestInitializerdisables bug reporting for the whole test process, andBugReportClientrefuses to send from test hosts. - Prefer testing pure logic through internal statics (for example
MountPathHelper,ScreenshotPaths,FileNameMatcher,DriveHelper,FuseFileSystem.BuildMountArguments).
- The UI log pane shows the same messages that are written to the daily log file; the newest log is the first thing to inspect.
- Press F8 to capture the current window to the
Screenshotfolder (see Screenshots). - Startup failures are logged before the UI exists; run the executable from a terminal to see console output.
-
BugReportSinkonly forwards Warning+ events. To reproduce a bug report locally, enable sending withBugReportClient.IsSendingEnabled = true(production entry points do this) and watch the log file forBugReportClient:messages.
CHDMounter_Tester is a Windows-only WPF tool for batch-parsing folders of CHD files:
- Select a folder containing
.chdfiles. - Choose a console type.
- Click Run Tests to parse every file and collect statistics.
- Click Export PDF to save a report.
It is intentionally not published in releases; build it from source with
dotnet run --project CHDMounter_Tester/CHDMounter_Tester.csproj.
Console file system parsers and the alias registry live in the external
VideoGameFileSystemParser
package — not in this repository. To add a format, contribute the parser there, then bump the
VideoGameFileSystemParser package reference in CHDMounter/CHDMounter.csproj. The alias list
shown in the UI and accepted by /s:<alias> updates automatically because it is read from the
library's ParserFactory.
This documentation lives in docs/. Add a page, link it from docs/index.md, docs/toc.yml
and docs/_Sidebar.md, then open a pull request. The docs workflow builds the site with docfx
and publishes it to GitHub Pages and the wiki.