rocksdanister/lively · error · PluginNotFoundException

Wallpaper player not found.

Error message

Wallpaper player not found.

What it means

Terminal throw at the end of CreateWallpaper; reached only when no case produced an IWallpaper. The outer switch has no default and each inner player-enum switch (WebBrowser/VideoPlayer/GifPlayer/PicturePlayer) has no default either, so an unhandled WallpaperType or an unhandled player-enum value falls straight through to this throw. It is effectively an 'incomplete switch' signal, not a normal runtime error.

Source

Thrown at src/Lively/Lively/Factories/WallpaperPluginFactory.cs:206

                                                        display,
                                                        lpFactory.CreateLivelyPropertyFolder(model, display, arrangement, userSettings),
                                                        userSettings.Settings.WebDebugPort,
                                                        userSettings.Settings.CefDiskCache,
                                                        userSettings.Settings.ApplicationTheme,
                                                        userSettings.Settings.AudioVolumeGlobal),
                            _ => new WebWebView2(model.FilePath,
                                                    model,
                                                    display,
                                                    userSettings.Settings.WebDebugPort,
                                                    lpFactory.CreateLivelyPropertyFolder(model, display, arrangement, userSettings),
                                                    GetWebView2UserDataDir(arrangement, display, isWindowed),
                                                    userSettings.Settings.ApplicationTheme,
                                                    userSettings.Settings.AudioVolumeGlobal,
                                                    GetWebView2Scale(display, isWindowed)),
                        };
                    }
            }
            throw new PluginNotFoundException("Wallpaper player not found.");
        }

        private string GetWebView2UserDataDir(WallpaperArrangement arrangement, DisplayMonitor display, bool isWindowed)
        {
            return userSettings.Settings.CefDiskCache && !isWindowed ? 
                webView2UserDataFactory.GetUserDataFolder(arrangement, display) : webView2UserDataFactory.GetTempUserDataFolder();
        }

        private double? GetWebView2Scale(DisplayMonitor display, bool isWindowed)
        {
            if (isWindowed || !displayManager.IsMultiScreen())
                return null;

            // When running as child of WorkerW/Progman, the WebView2 surface does not pick up the correct DPI. 
            return DpiUtil.TryGetDisplayScale(display.HMonitor, out double targetScale) ? targetScale : null;
        }

        #region exceptions

View on GitHub (pinned to c1036feb66)

Solutions

  1. Log model.LivelyInfo.Type and the active player-enum value at the call site before invoking CreateWallpaper to see which dimension was unhandled.
  2. Add a default arm to each inner switch that either picks a known-good backend or throws a precise, type-specific message.
  3. Ensure the shipped build compiles in at least one backend for each wallpaper category the enum advertises.

Example fix

// before
            }
            throw new PluginNotFoundException("Wallpaper player not found.");
        }

// after: diagnose which dimension was unhandled
            var combo = model.LivelyInfo.Type switch
            {
                WallpaperType.web or WallpaperType.webaudio or WallpaperType.url => $"web:{userSettings.Settings.WebBrowser}",
                WallpaperType.video => $"video:{userSettings.Settings.VideoPlayer}",
                WallpaperType.gif   => $"gif:{userSettings.Settings.GifPlayer}",
                WallpaperType.picture => $"picture:{userSettings.Settings.PicturePlayer}",
                _ => $"{model.LivelyInfo.Type}"
            };
            throw new PluginNotFoundException($"Wallpaper player not found (type/player={combo}).");
Defensive patterns

Strategy: validation

Validate before calling

static bool IsFactoryComboSupported(LibraryModel m, IUserSettingsService s) =>
    m.LivelyInfo.Type switch
    {
        WallpaperType.web or WallpaperType.webaudio or WallpaperType.url =>
            s.Settings.WebBrowser is LivelyWebBrowser.cef or LivelyWebBrowser.webview2,
        WallpaperType.video =>
            s.Settings.VideoPlayer is LivelyMediaPlayer.wmf or LivelyMediaPlayer.libvlcExt
                or LivelyMediaPlayer.mpv or LivelyMediaPlayer.vlc,
        WallpaperType.gif =>
            s.Settings.GifPlayer is LivelyGifPlayer.mpv or LivelyGifPlayer.libvlcExt,
        WallpaperType.picture =>
            s.Settings.PicturePlayer is LivelyPicturePlayer.winApi
                or LivelyPicturePlayer.mpv or LivelyPicturePlayer.wmf,
        WallpaperType.videostream => true,
        _ => false
    };

Type guard

static bool IsKnownWallpaperType(LibraryModel m) =>
    Enum.IsDefined(typeof(WallpaperType), m.LivelyInfo.Type);

Try / catch

try
{
    var wp = factory.CreateWallpaper(model, display, arrangement);
}
catch (WallpaperPluginFactory.PluginNotFoundException ex)
{
    Logger.Error(ex, "No backend for type={Type}", model.LivelyInfo.Type);
    // fall back to a guaranteed-present backend, or surface a precise message to the user
}

Prevention

When it happens

Trigger: CreateWallpaper returns from none of its cases: model.LivelyInfo.Type is an enum value with no case, or the inner player switch has no matching case for the configured value (e.g. WebBrowser other than cef/webview2, VideoPlayer with no case, GifPlayer/PicturePlayer with no case).

Common situations: A new WallpaperType or player enum value was added but the factory wasn't updated. A build compiled without CEF (so the web switch only has webview2) while config selects cef. A corrupted LivelyInfo.Type that resolves to an undefined enum member.

Related errors


AI-assisted analysis of rocksdanister/lively@c1036feb66 (2026-08-13). Data as JSON: /api/errors/0168f30224c84f01. Report an issue: GitHub.