xperiandri
**Describe the bug** `COMException` is thrown during startup: `OnSettingsSaved must be called on the UI thread.` `RatingPrompt.IncrementAsync` triggers `BaseOptionModel<General>.SaveAsync`, which internally calls `WorkspaceRootNode.OnSettingsSaved`. That method asserts the UI thread via `ThreadHelper.ThrowIfNotOnUIThread()`, but the async continuation resumes on a background thread after an `await` with no `SwitchToMainThreadAsync` before `SaveAsync`. **To Reproduce** 1. Install WorkspaceFiles v1.0.151 in Visual Studio 2026 (18.9.0-insiders) 2. Open any solution 3. Wait for the extension to load and trigger the rating prompt increment on startup 4. Observe the exception in the debugger or Output window **Expected behavior** No exception. Settings should be saved without crashing, regardless of which thread the async continuation resumes on. **Screenshots** N/A **Additional context** Call stack at the time of the exception: ``` System.Runtime.InteropServices.COMException: OnSettingsSaved must be called on the UI thread. at Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(String callerMemberName) at WorkspaceFiles.WorkspaceRootNode.OnSettingsSaved() at Community.VisualStudio.Toolkit.BaseOptionModel`1.SaveAsync() at Community.VisualStudio.Toolkit.RatingPrompt.IncrementAsync() [Resuming Async Method — background thread] ``` The fix would be to add `await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync()` before calling `SaveAsync()` inside `RatingPrompt.IncrementAsync`, or to remove the `ThrowIfNotOnUIThread` guard from `OnSettingsSaved` if it does not actually require the UI thread. - **Visual Studio:** Enterprise 2026 (18.9.0-insiders) - **WorkspaceFiles version:** 1.0.151