build: debug the Windows programs from VS Code

F5 in VS Code now starts Titano, the Uploader and the server under the C#
extension's debugger, as well as the --capture runs, Titano.Tools and the test
programs. Each configuration builds in Debug first and starts the program's
.exe rather than its .dll, because the programs read Environment.ProcessPath
(Setup's payload, the Run keys and tray icons). The server's session keeps its
data and archive in out/debug/server instead of %ProgramData% and
C:\TitanoArchive.

The build tasks use no reused MSBuild nodes, whose cached drive-letter case
made every F5 build restore and C# Dev Kit reload, and keep MSB3026 (a copy
that succeeds on a retry) a warning so a file held for a moment no longer
stops F5.

Design-time builds skip the icon generation, which on a fresh clone ran a
Titano.Tools.dll that did not exist yet (MSB3073 in VS Code), and log WPF's
MC1000 about projects not built yet as a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-15 14:53:12 +02:00
1 parent 48923d0776
commit 19265b36c2
8 files changed
+365 -1

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
{
// The coreclr debugger of launch.json comes with the C# extension.
"recommendations": ["ms-dotnettools.csharp"]
}
+188
View File
@@ -0,0 +1,188 @@
{
// Windows programs under the C# extension's debugger. Each launch configuration builds in Debug first (tasks.json),
// then starts the program's .exe, never "dotnet <program>.dll": the programs read Environment.ProcessPath (the Run
// keys and tray icons of Titano and the Uploader, Setup's payload and the stub of its capture's sample installer).
"version": "0.2.0",
"configurations": [
{
"name": "Titano",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano",
"program": "${workspaceFolder}/src/Titano.App/bin/Debug/net10.0-windows/Titano.exe",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "1-programs",
"order": 1
}
},
{
"name": "Titano Uploader",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano Uploader",
"program": "${workspaceFolder}/src/Titano.Uploader/bin/Debug/net10.0-windows/Titano.Uploader.exe",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "1-programs",
"order": 2
}
},
{
// SQLite, as on any Windows server, with the data and the archive in out/debug/server instead of
// %ProgramData%\Titano Server and C:\TitanoArchive. The first administrator's temporary password is in
// out/debug/server/data/initial-admin-password.txt.
"name": "Titano Server",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano Server",
"program": "${workspaceFolder}/src/Titano.Server/bin/Debug/net10.0/Titano.Server.exe",
"cwd": "${workspaceFolder}",
"env": {
"TITANO_DATA_PATH": "${workspaceFolder}\\out\\debug\\server\\data",
"TITANO_ARCHIVE_PATH": "${workspaceFolder}\\out\\debug\\server\\archive"
},
"console": "internalConsole",
"serverReadyAction": {
"action": "openExternally",
"pattern": "Now listening on: https://\\S+:(\\d+)",
"uriFormat": "https://localhost:%s/admin/"
},
// The server makes its own certificate (data\tls); the ASP.NET Core development certificate plays no part.
"checkForDevCert": false,
"presentation": {
"group": "1-programs",
"order": 3
}
},
{
// Every screen with sample data in a throw-away data folder, as the CI screenshots step runs it.
"name": "Titano (screenshots)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano",
"program": "${workspaceFolder}/src/Titano.App/bin/Debug/net10.0-windows/Titano.exe",
"args": ["--capture", "${workspaceFolder}\\out\\screenshots"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "2-screenshots",
"order": 1
}
},
{
"name": "Titano Uploader (screenshots)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano Uploader",
"program": "${workspaceFolder}/src/Titano.Uploader/bin/Debug/net10.0-windows/Titano.Uploader.exe",
"args": ["--capture", "${workspaceFolder}\\out\\screenshots"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "2-screenshots",
"order": 2
}
},
{
// Setup has no payload outside a packed installer: the capture builds a sample one and installs nothing.
"name": "Titano Setup (screenshots)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano Setup",
"program": "${workspaceFolder}/src/Titano.Setup/bin/Debug/net10.0-windows/Titano.Setup.exe",
"args": ["--capture", "${workspaceFolder}\\out\\screenshots"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "2-screenshots",
"order": 3
}
},
{
"name": "Titano.Tools",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build: Titano.Tools",
"program": "${workspaceFolder}/src/Titano.Tools/bin/Debug/net10.0/Titano.Tools.exe",
"args": "${input:toolsArguments}",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "3-development",
"order": 1
}
},
{
"name": "Tests",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/tests/${input:testProgram}",
"args": "${input:testArguments}",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"presentation": {
"group": "3-development",
"order": 2
}
},
{
"name": "Attach to process",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}",
"presentation": {
"group": "3-development",
"order": 3
}
}
],
"inputs": [
{
"id": "toolsArguments",
"type": "promptString",
"description": "Titano.Tools command and options (--help lists them; changelog needs --in <file> here)",
"default": "i18n check"
},
{
"id": "testProgram",
"type": "pickString",
"description": "Test program",
"options": [
{
"label": "Titano.Core.Tests",
"value": "Titano.Core.Tests/bin/Debug/net10.0/Titano.Core.Tests.exe"
},
{
"label": "Titano.Core.Windows.Tests",
"value": "Titano.Core.Windows.Tests/bin/Debug/net10.0-windows/Titano.Core.Windows.Tests.exe"
},
{
"label": "Titano.Data.Tests",
"value": "Titano.Data.Tests/bin/Debug/net10.0/Titano.Data.Tests.exe"
},
{
"label": "Titano.Server.Tests",
"value": "Titano.Server.Tests/bin/Debug/net10.0/Titano.Server.Tests.exe"
},
{
"label": "Titano.App.Tests",
"value": "Titano.App.Tests/bin/Debug/net10.0-windows/Titano.App.Tests.exe"
},
{
"label": "Titano.Tools.Tests",
"value": "Titano.Tools.Tests/bin/Debug/net10.0/Titano.Tools.Tests.exe"
}
]
},
{
"id": "testArguments",
"type": "promptString",
"description": "Options: --filter <text|category:name>, --exclude <text>, --parallel <n>, --list, --verbose",
"default": "--parallel 1"
}
]
}
+128
View File
@@ -0,0 +1,128 @@
{
// Debug builds for the configurations in launch.json. The classic console logger (no terminal logger, full paths,
// no wrapping) prints each diagnostic on one line for the $msCompile problem matcher. No reused MSBuild nodes: they
// keep the drive letter's case of earlier builds (VS Code passes it in lower case), and the mixed-case restores
// they caused made every build restore and C# Dev Kit reload. A copy that succeeds on a retry (MSB3026: a file held
// for a moment by an antivirus or another build) does not fail the build; one that never succeeds still does
// (MSB3027).
"version": "2.0.0",
"tasks": [
{
"label": "build",
"detail": "Titano.slnx, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/Titano.slnx",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "build: Titano",
"detail": "src/Titano.App, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/src/Titano.App/Titano.App.csproj",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "build: Titano Uploader",
"detail": "src/Titano.Uploader, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/src/Titano.Uploader/Titano.Uploader.csproj",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "build: Titano Server",
"detail": "src/Titano.Server, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/src/Titano.Server/Titano.Server.csproj",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "build: Titano Setup",
"detail": "src/Titano.Setup, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/src/Titano.Setup/Titano.Setup.csproj",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "build: Titano.Tools",
"detail": "src/Titano.Tools, Debug",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/src/Titano.Tools/Titano.Tools.csproj",
"-c",
"Debug",
"-tl:off",
"-nodeReuse:false",
"-p:GenerateFullPaths=true",
"-p:MSBuildWarningsNotAsErrors=MSB3026",
"-consoleLoggerParameters:ForceNoAlign"
],
"group": "build",
"problemMatcher": "$msCompile"
}
]
}
+6
View File
@@ -35,6 +35,12 @@
<DebugType>embedded</DebugType>
</PropertyGroup>
<!-- Design-time builds (C# Dev Kit, Visual Studio) of a fresh clone: WPF's markup compile cannot load project
references not built yet (MC1000, a warning there that warnings as errors would turn back into an error). -->
<PropertyGroup Condition="'$(DesignTimeBuild)' == 'true'">
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MC1000</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup>
<!-- Public repository that hosts releases, update checks and the Unraid template (BRIEF §19.4). -->
<TitanoReleasesRepo Condition="'$(TitanoReleasesRepo)' == ''">alby96/titano-releases</TitanoReleasesRepo>
+3 -1
View File
@@ -27,8 +27,10 @@
GlobalPropertiesToRemove="RuntimeIdentifier;SelfContained;PublishSingleFile;PublishReadyToRun;TargetFramework"
Private="false" />
</ItemGroup>
<!-- Not in design-time builds (C# Dev Kit, Visual Studio): they build no project references, so Titano.Tools may not
exist yet, and they compile nothing that needs the icon. -->
<Target Name="TitanoGenerateIcons"
Condition="'$(TitanoIconVariant)' != ''"
Condition="'$(TitanoIconVariant)' != '' and '$(DesignTimeBuild)' != 'true'"
AfterTargets="ResolveProjectReferences"
BeforeTargets="MarkupCompilePass1;CoreCompile">
<MSBuild Projects="$(RepoRoot)src\Titano.Tools\Titano.Tools.csproj"
+28
View File
@@ -57,6 +57,34 @@ docker compose -f deploy/docker/docker-compose.yml up -d
The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environment variables;
`Titano.Server --help` lists them. On Linux it needs PostgreSQL; on Windows it defaults to SQLite.
### Debug in VS Code (Windows)
Open the repository folder with the C# extension (`.vscode/extensions.json` recommends it), pick a configuration in
*Run and Debug* and press F5. Each launch configuration builds in Debug first (`.vscode/tasks.json`).
| Configuration | Starts |
|---|---|
| Titano, Titano Uploader | The desktop programs, with their usual data folder (`%LOCALAPPDATA%\Titano`) |
| Titano Server | The server on SQLite, ports 8080 and 8443, data and archive in `out/debug/server`; then opens the admin panel |
| … (screenshots) | `--capture out/screenshots` of Titano, the Uploader or Setup |
| Titano.Tools | The command line it asks for (`i18n check` by default) |
| Tests | The test program and runner options it asks for (`--filter`, `--parallel 1`, …), after building the solution |
| Attach to process | Nothing: attaches to a running process picked from a list |
- Sessions run side by side: start the next one with the green *Start* button in *Run and Debug* once the previous
build has finished (F5 starts a session only when none runs). *Tests* rebuilds the programs too, so stop their
sessions first when the code has changed.
- Quit an installed Titano or Uploader first: a second copy hands over to it and ends. Debugging the Uploader points
an existing *Start with Windows* entry at the Debug build. Closing the Uploader's window keeps it in the tray (the
default): end its session with *Stop*.
- Stop the Docker stack or an installed Titano Server before *Titano Server*, which needs the same ports. The browser
warns about the server's self-signed certificate; sign in as `admin` with the temporary password in
`out/debug/server/data/initial-admin-password.txt`.
- Titano, the Uploader and Setup log to files (`%LOCALAPPDATA%\Titano\logs`, `%TEMP%\Titano Setup`); the server logs
to the Debug Console. Windows Firewall asks about Titano, the Uploader and the server at their first start.
- VS Code passes the drive letter in lower case: the first build after one made with an upper-case drive letter
(another terminal, Visual Studio) restores and recompiles everything.
## CI
| Workflow | When | What |
+6
View File
@@ -15,6 +15,9 @@ commits follow Conventional Commits (release notes are generated from them by `T
- Localization runtime (`Loc`, CLDR plural rules with few/many forms, runtime culture switch, RTL), `en` + `it`
catalogs, machine translations with per-language glossaries, `i18n check/export/missing/import`.
- Brand mark geometry, SDF rasteriser, PNG encoder, ICO writer and `make-icon` (icons generated at build time).
- VS Code debug configurations for the Windows programs (`.vscode/launch.json`, `tasks.json`): Titano, the Uploader,
the server on SQLite with its data in `out/debug/server`, the screenshot captures, `Titano.Tools` and the test
programs, each built in Debug first.
#### Engine (Titano.Core)
- Metadata: signature sniffing, TIFF/Exif/GPS/XMP/MakerNotes, JPEG segments, ISO-BMFF (HEIF, CR3), RAF, PNG,
@@ -165,6 +168,9 @@ commits follow Conventional Commits (release notes are generated from them by `T
returns frames, frames version and settings of one frames version.
### Fixed
- Opening the repository in VS Code with C# Dev Kit before the first build listed MSB3073 for Titano, the Uploader
and Setup: design-time builds no longer generate the program icons, and log WPF's MC1000 about projects not built
yet as a message.
- Server: downloading the current log while it was being written aborted the response (Content-Length mismatch); it
now serves the bytes listed at request time.
- Mass rename and move: a dry run asked for right after typing was replaced by the pending debounced one, so *Apply*
+2
View File
@@ -395,3 +395,5 @@ One line per decision: date · decision · alternative · reason.
| 2026-10-12 | Equal frames versions in a sidecar and an index row mean the same frames only when the row's frame ids and order are the sidecar's (`ArchiveIndexer.OtherFramesAsync`). Otherwise the scan treats it as any frames change: it reads the sidecar again under the lease, writes it one version past the row, moves the project's positions and, on a server, clears what covered the frames. Refines 2026-10-12 'The index's frames version never goes back.' | Compare versions only; make the bump unique (a counter kept in the sidecar, a timestamp) | Each index of a shared archive bumps a sidecar put back behind its own row to one past that row. That can be the version another index already holds for other frames, for example a desktop rebuilding a damaged sidecar while the server is one upload ahead. That index then kept its positions, statuses, sync diff and proxy cache, and accepted editors' saves made against frames that had changed. A counter in the sidecar goes back with the sidecar it is put back with. The frame list is read only when the versions match, and the scan writes every frame row in that case anyway. |
| 2026-10-13 | `SequenceAdopter.Reconcile` returns null, and the sidecar is left as it was, when the photos it found could not be read and no frame's missing flag changed. | Index the photo without metadata; flag it | A photo held open by another program, without read permission or not downloaded yet is read at the next scan or fix. Treating its folder as changed rewrote the sidecar, cleared the covering flags and queued the analyses (with a deep analysis, hours) again at every orphans fix. |
| 2026-10-13 | A deep pass counts as current only when its report describes the frames as this host reads them under the lock, proxies included (`SequenceAnalyser.Describes`), besides an unchanged frames version. Otherwise it replaces only a saved report that does not describe them either (`ReadReport` of the frames as they are). Refines 2026-10-12 'A deep analysis saves `analysis.json` under the sequence lock…'. | Compare frames versions only | A proxy arriving moves no frames version but makes an unreadable verdict on that frame's original stale. A pass that started before it overwrote the report a later pass made from the proxies, then dropped the deep status. |
| 2026-10-15 | VS Code debugs the Windows programs with the C# extension's `coreclr` debugger (`.vscode/launch.json`): Titano, the Uploader, the server, the `--capture` runs of Titano, the Uploader and Setup, `Titano.Tools` and the test programs (these two ask for their arguments). Each launch configuration builds in Debug first (`.vscode/tasks.json`; *Tests* builds the solution) and starts the program's `.exe`. The server's session keeps its data and archive in `out/debug/server` (`TITANO_DATA_PATH`, `TITANO_ARCHIVE_PATH`) and its default ports; Titano and the Uploader use their usual data folder. The build tasks use no reused MSBuild nodes and keep MSB3026 a warning. | C# Dev Kit's `dotnet` launch type with `launchSettings.json`; start `dotnet <program>.dll`; the server's default folders; ports of its own for the server; a portable copy (`portable.txt`) for the desktop programs; reused MSBuild nodes; MSB3026 as an error | The `coreclr` debugger needs only the C# extension. Started as a `.dll`, the process is `dotnet.exe`, which the programs read as their own path (`Environment.ProcessPath`): Setup's payload and the stub of its capture's sample installer, the Run keys and tray icons. A console run creates `%ProgramData%\Titano Server` owned by the developer, which the service then refuses (the console-run data folder rows), and `C:\TitanoArchive` at the drive root. On the default ports the clients reach the debug server as they reach an installed one; the README says to stop the Docker stack or an installed server first. A portable copy would run other code than an installed one (data beside the program, the portable update download). MSB3026 reports a copy that a retry then completes (a file held for a moment by an antivirus or another build): as an error it stopped F5 although the build succeeded, while a copy that never succeeds still fails (MSB3027). Reused MSBuild nodes keep the drive letter's case of the build that started them, while VS Code passes it in lower case: restores mixed both cases, rewrote `project.assets.json` at every build and made C# Dev Kit reload the projects, so no F5 build was a no-op (7 to 14 s for Titano instead of about 5 s). |
| 2026-10-15 | Design-time builds (`DesignTimeBuild=true`: C# Dev Kit, Visual Studio) skip the `TitanoGenerateIcons` target (`Directory.Build.targets`) and log WPF's MC1000 as a message (`Directory.Build.props`). Refines 2026-10-02 'Program icons (ICO) are generated at build time…'. | Build `Titano.Tools` from the design-time build; no warnings as errors in design-time builds; leave it | A design-time build builds no project references, so on a fresh clone `make-icon` ran a `Titano.Tools.dll` that did not exist yet: VS Code listed MSB3073 for Titano, the Uploader and Setup when the folder opened. A design-time build compiles nothing, so it needs no icon. Past that target, the markup compile of their XAML cannot load `Titano.Ui.dll` before the first build: MC1000, which the design-time build makes a warning and warnings as errors made an error again (21 of them). Without warnings as errors they would still be listed, as warnings. Real builds still fail on MC1000. |