Build WinForms Quickstart for .NET 4.8 Windows 11#251
Build WinForms Quickstart for .NET 4.8 Windows 11#251Aaron LaBeau (biozal) wants to merge 9 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Windows Forms quickstart targeting .NET Framework 4.8 (Windows 11 / VS) using an experimental Ditto SDK build, largely mirroring the existing modern WinForms sample.
Changes:
- Introduces a new
dotnet-winforms-net48/WinForms app (UI + Ditto CRUD/observe wrapper) targeting net48. - Adds net48-specific build assets (solution/project,
packages.config, native DLL copy rule). - Adds local
.env-based configuration loading and quickstart documentation.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet-winforms-net48/packages.config | Pins Ditto experimental net48-support packages and supporting dependencies. |
| dotnet-winforms-net48/ToDoTask.cs | Task document model for the tasks collection (Newtonsoft.Json attributes). |
| dotnet-winforms-net48/TasksPeerService.cs | Singleton service wrapper around TasksPeer for app-wide access. |
| dotnet-winforms-net48/TasksPeer.cs | Ditto SDK wrapper implementing CRUD + subscription + observation for tasks. |
| dotnet-winforms-net48/Taskapp.WinForms.Net48.sln | New VS solution for the net48 WinForms quickstart. |
| dotnet-winforms-net48/Taskapp.WinForms.Net48.csproj | Net48 WinForms project file with explicit assembly refs and native DLL copy. |
| dotnet-winforms-net48/README.md | Net48-specific prerequisites and run instructions. |
| dotnet-winforms-net48/Properties/Settings.settings | Default settings file for WinForms project scaffolding. |
| dotnet-winforms-net48/Properties/Settings.Designer.cs | Auto-generated Settings designer. |
| dotnet-winforms-net48/Properties/Resources.resx | Project resources container. |
| dotnet-winforms-net48/Properties/Resources.Designer.cs | Auto-generated Resources designer. |
| dotnet-winforms-net48/Properties/AssemblyInfo.cs | Assembly metadata for net48 build. |
| dotnet-winforms-net48/Program.cs | WinForms entry point with async initialization via a loading dialog. |
| dotnet-winforms-net48/MainForm.resx | Resources for the main WinForms UI. |
| dotnet-winforms-net48/MainForm.cs | Main UI logic: list rendering + add/edit/delete + done toggling. |
| dotnet-winforms-net48/MainForm.Designer.cs | Main form designer-generated layout. |
| dotnet-winforms-net48/LoadingForm.cs | Modal loading form that awaits Ditto initialization. |
| dotnet-winforms-net48/LoadingForm.Designer.cs | Loading form designer-generated layout. |
| dotnet-winforms-net48/InputDialog.cs | Simple modal input dialog for editing task titles. |
| dotnet-winforms-net48/AppConfiguration.cs | .env loader and required config validation. |
| dotnet-winforms-net48/App.config | Declares .NET Framework 4.8 runtime. |
| dotnet-winforms-net48/.env.sample | Sample environment file template for required Ditto settings. |
Files not reviewed (4)
- dotnet-winforms-net48/LoadingForm.Designer.cs: Language not supported
- dotnet-winforms-net48/MainForm.Designer.cs: Language not supported
- dotnet-winforms-net48/Properties/Resources.Designer.cs: Language not supported
- dotnet-winforms-net48/Properties/Settings.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 22 changed files in this pull request and generated 2 comments.
Files not reviewed (4)
- dotnet-winforms-net48/LoadingForm.Designer.cs: Language not supported
- dotnet-winforms-net48/MainForm.Designer.cs: Language not supported
- dotnet-winforms-net48/Properties/Resources.Designer.cs: Language not supported
- dotnet-winforms-net48/Properties/Settings.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Microsoft Windows 11, this uses .NET 4.8 for Windows only | ||
| - Visual Studio 2019 or higher (tested on Visual Studio 2019/2026) | ||
| - x64 version of Windows (does NOT support 32-bit Windows) | ||
| - Does not support ARM64 (however can run on Windows on Windows with x64 emulation if supported by OS/hardware). ARM64 is not officially supported by Ditto for use with the .NET 4.8 framework. |
There was a problem hiding this comment.
Typo/duplication: "can run on Windows on Windows" reads like an accidental repeat and is hard to parse. Consider rephrasing to a single "Windows" and clarifying the emulation requirement.
| - Does not support ARM64 (however can run on Windows on Windows with x64 emulation if supported by OS/hardware). ARM64 is not officially supported by Ditto for use with the .NET 4.8 framework. | |
| - Does not support ARM64 (however, it can run on Windows on ARM using x64 emulation if supported by the OS/hardware). ARM64 is not officially supported by Ditto for use with the .NET 4.8 framework. |
| var peer = new TasksPeer(appId, playgroundToken, authUrl, websocketUrl); | ||
| peer.Authenticate(); | ||
| peer.RegisterSubscription(); | ||
| await peer.InsertInitialTasks(); | ||
| peer.StartSync(); | ||
|
|
||
| return peer; | ||
| } | ||
|
|
||
| private void Authenticate() | ||
| { | ||
| _ditto.Auth.ExpirationHandler = async (ditto, secondsRemaining) => | ||
| { | ||
| // Authenticate when token is expiring | ||
| try | ||
| { | ||
| await ditto.Auth.LoginAsync( | ||
| // Your development token, replace with your actual token | ||
| PlaygroundToken, | ||
| // Use DittoAuthenticationProvider.Development for playground, or your actual provider | ||
| DittoAuthenticationProvider.Development | ||
| ); | ||
| Console.WriteLine("Authentication successful"); | ||
| } | ||
| catch (Exception error) | ||
| { | ||
| Console.WriteLine($"Authentication failed: {error}"); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Authenticate() only sets ExpirationHandler but never performs an initial login. As a result, the peer may start sync and register subscriptions without ever authenticating (the expiration handler may not run until after a successful login). Consider calling LoginAsync during Create (and keeping ExpirationHandler for refresh) so initialization deterministically authenticates before RegisterSubscription() / StartSync().
This PR provides a Quickstart for Windows 11 and .NET version 4.8. This version targets a pre-release version of the Ditto SDK and was requested by Brian Plattenburg (@bplattenburg).
This shares as much code as possible with the modern version of Windows Form Quickstart example. Very important notes:
No tests are provided for the app currently.