diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4974ad6..bcfd7e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Extract version from tag id: version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12f41a3..f9f0751 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Restore dependencies run: dotnet restore CanonSDK.sln diff --git a/CHANGELOG.md b/CHANGELOG.md index f454262..aa32e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ Versions match the Git tags (`v1.0.0.11`) that trigger the release workflow. - The release workflow refuses to run when the tag does not point to the latest commit of `main`, so the published package always matches the tag. +- **Migrated from .NET 9 to .NET 10 (LTS)**, supported until November 2028 (.NET 9 support ends in November 2026). + The release is still a self-contained executable: nothing to install on the photo booth computers. +- Packages updated (ASP.NET Core OpenAPI 10, Serilog.AspNetCore 10, Swagger UI 10, AutoUpdater.NET 1.9.3). +- The OpenAPI document is now OpenAPI 3.1 (was 3.0), without duplicated schemas. + ### Added - CI workflow building the solution and running the unit tests on every pull request and push to `main`. diff --git a/CLAUDE.md b/CLAUDE.md index 9a30437..30e2018 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -CanonWebAPI is a .NET 9 web API for remotely controlling Canon DSLR and mirrorless cameras through the Canon EDSDK. The solution provides REST endpoints for camera control, live view streaming, and image capture. +CanonWebAPI is a .NET 10 web API for remotely controlling Canon DSLR and mirrorless cameras through the Canon EDSDK. The solution provides REST endpoints for camera control, live view streaming, and image capture. ## Architecture @@ -86,7 +86,7 @@ Errors are problem details: 400 invalid value, 409 capture refused, 503 not conn - The camera can be connected via USB before or after the application starts (automatic connection and reconnection) - Canon EOS Utility must NOT be running (conflicts with EDSDK access) - Requires compatible Canon camera with EDSDK support -- All projects target .NET 9 with Windows-specific dependencies +- All projects target .NET 10 (`net10.0-windows`) with Windows-specific dependencies - Uses structured logging with Serilog (logs to console and `logs/canon-api.log`) - Target deployment: photo booth with a Canon EOS R100, dummy battery, no memory card (pictures are saved to the PC only) - `docs/openapi.json` must be regenerated when endpoints change diff --git a/Canon.API/Canon.API.csproj b/Canon.API/Canon.API.csproj index eadf3eb..10eeaef 100644 --- a/Canon.API/Canon.API.csproj +++ b/Canon.API/Canon.API.csproj @@ -1,7 +1,7 @@ - net9.0-windows + net10.0-windows enable enable x64 @@ -32,12 +32,12 @@ - - - - + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Canon.Core.Tests/Canon.Core.Tests.csproj b/Canon.Core.Tests/Canon.Core.Tests.csproj index 4a4b607..95942aa 100644 --- a/Canon.Core.Tests/Canon.Core.Tests.csproj +++ b/Canon.Core.Tests/Canon.Core.Tests.csproj @@ -1,7 +1,7 @@ - net9.0-windows + net10.0-windows enable enable x64 @@ -10,9 +10,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Canon.Core/Canon.Core.csproj b/Canon.Core/Canon.Core.csproj index 11061db..178938b 100644 --- a/Canon.Core/Canon.Core.csproj +++ b/Canon.Core/Canon.Core.csproj @@ -1,7 +1,7 @@  - net9.0-windows + net10.0-windows enable enable x64 @@ -21,7 +21,7 @@ - + diff --git a/Directory.Build.props b/Directory.Build.props index 4e944cf..f91b780 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - + true diff --git a/Dockerfile b/Dockerfile index d87a81c..7ab8ad3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ARG WINDOWS_VERSION=ltsc2022 # --------------------------------------------------------------------------- # Build and unit tests # --------------------------------------------------------------------------- -FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-${WINDOWS_VERSION} AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0-windowsservercore-${WINDOWS_VERSION} AS build WORKDIR C:\src # Restore first so the package layer is cached when only the code changes. diff --git a/README.md b/README.md index 5179cce..f4689e5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The solution is divided into the following projects: * A compatible Canon camera (tested with **Canon EOS R100** and **Canon T7**). * The camera connected to the computer via USB. -* **.NET 9 SDK** (or newer). +* **.NET 10 SDK** (or newer) to build the project. * The Canon EOS Utility software should not be running, as it can prevent this application from connecting to the camera. * **Windows** operating system (x64 architecture required). @@ -211,7 +211,7 @@ dotnet build Canon.API -p:OpenApiGenerateDocumentsOnBuild=true ### System Requirements * **OS**: Windows 10/11 (x64) -* **Runtime**: .NET 9 or newer +* **Runtime**: none to install: the release is a self-contained executable (.NET 10) * **Dependencies**: Canon EDSDK 13.20.21 64-bit libraries (included; up to 1.0.0.11: EDSDK 13.19.0) > **Note**: While this software has been tested with the above camera models, it should work with other Canon cameras that support the EDSDK. However, functionality may vary depending on the specific camera model and its supported features. diff --git a/docs/openapi.json b/docs/openapi.json index 548d459..5ca7563 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.1.1", "info": { "title": "Canon Web API", "description": "Remote control of a Canon camera through the Canon EDSDK: settings, capture and MJPEG live view. Errors are returned as problem details: 400 invalid value, 409 capture refused by the camera, 503 camera not connected or busy, 504 capture timeout.", @@ -120,7 +120,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CameraMode2" + "$ref": "#/components/schemas/CameraMode" } } } @@ -161,7 +161,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemperatureStatus2" + "$ref": "#/components/schemas/TemperatureStatus" } } } @@ -202,7 +202,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FlashStatus2" + "$ref": "#/components/schemas/FlashStatus" } } } @@ -261,7 +261,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FlashStatus2" + "$ref": "#/components/schemas/FlashStatus" } } } @@ -807,8 +807,7 @@ "in": "query", "description": "Comma separated file types to return (e.g. \"jpg\", \"cr3\", \"jpg,cr3\", \"*\"). Defaults to the Canon:CaptureFileTypes setting (JPEG only).", "schema": { - "type": "string", - "default": null + "type": "string" } } ], @@ -1063,33 +1062,11 @@ "type": "object", "properties": { "aeModeCode": { - "type": "integer", - "format": "uint32" - }, - "aeMode": { - "type": "string" - }, - "isCreativeZone": { - "type": "boolean" - }, - "isMovieMode": { - "type": "boolean", - "nullable": true - } - }, - "nullable": true - }, - "CameraMode2": { - "required": [ - "aeModeCode", - "aeMode", - "isCreativeZone", - "isMovieMode" - ], - "type": "object", - "properties": { - "aeModeCode": { - "type": "integer", + "pattern": "^-?(?:0|[1-9]\\d*)$", + "type": [ + "integer", + "string" + ], "format": "uint32" }, "aeMode": { @@ -1099,8 +1076,10 @@ "type": "boolean" }, "isMovieMode": { - "type": "boolean", - "nullable": true + "type": [ + "null", + "boolean" + ] } } }, @@ -1121,28 +1100,57 @@ "type": "boolean" }, "cameraName": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "liveViewActive": { "type": "boolean" }, "liveViewClients": { - "type": "integer", + "pattern": "^-?(?:0|[1-9]\\d*)$", + "type": [ + "integer", + "string" + ], "format": "int32" }, "mode": { - "$ref": "#/components/schemas/CameraMode" + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/CameraMode" + } + ] }, "temperature": { - "$ref": "#/components/schemas/TemperatureStatus" + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/TemperatureStatus" + } + ] }, "flash": { - "$ref": "#/components/schemas/FlashStatus" + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/FlashStatus" + } + ] }, "error": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } } }, @@ -1159,41 +1167,19 @@ "type": "boolean" }, "firing": { - "type": "boolean", - "nullable": true + "type": [ + "null", + "boolean" + ] }, "forcedBeforeCapture": { "type": "boolean" }, "lastError": { - "type": "string", - "nullable": true - } - }, - "nullable": true - }, - "FlashStatus2": { - "required": [ - "isSupported", - "firing", - "forcedBeforeCapture", - "lastError" - ], - "type": "object", - "properties": { - "isSupported": { - "type": "boolean" - }, - "firing": { - "type": "boolean", - "nullable": true - }, - "forcedBeforeCapture": { - "type": "boolean" - }, - "lastError": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } } }, @@ -1201,25 +1187,37 @@ "type": "object", "properties": { "type": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "title": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "status": { - "type": "integer", - "format": "int32", - "nullable": true + "pattern": "^-?(?:0|[1-9]\\d*)$", + "type": [ + "null", + "integer", + "string" + ], + "format": "int32" }, "detail": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] }, "instance": { - "type": "string", - "nullable": true + "type": [ + "null", + "string" + ] } } }, @@ -1259,39 +1257,13 @@ "type": "boolean" }, "rawValue": { - "type": "integer", - "format": "uint32", - "nullable": true - }, - "status": { - "type": "string" - }, - "movieStatus": { - "type": "string" - }, - "isWarning": { - "type": "boolean" - } - }, - "nullable": true - }, - "TemperatureStatus2": { - "required": [ - "isSupported", - "rawValue", - "status", - "movieStatus", - "isWarning" - ], - "type": "object", - "properties": { - "isSupported": { - "type": "boolean" - }, - "rawValue": { - "type": "integer", - "format": "uint32", - "nullable": true + "pattern": "^-?(?:0|[1-9]\\d*)$", + "type": [ + "null", + "integer", + "string" + ], + "format": "uint32" }, "status": { "type": "string"