{"record":{"id":"fee335955ced6dc7","repo":"Unity-Technologies/UnityCsReference","slug":"playersettings-phonemediumtile140-is-deprecated-u","errorCode":null,"errorMessage":"PlayerSettings.phoneMediumTile140 is deprecated. Use GetVisualAssetsImage() instead.","messagePattern":"PlayerSettings\\.phoneMediumTile140 is deprecated\\. Use GetVisualAssetsImage\\(\\) instead\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/PlayerSettingsWSA.cs","lineNumber":597,"sourceCode":"            public static string phoneMediumTile\n            {\n                get\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile is deprecated. Use GetVisualAssetsImage() instead.\");\n                }\n                set\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile is deprecated. Use SetVisualAssetsImage() instead.\");\n                }\n            }\n\n            [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n            [Obsolete(\"Use GetVisualAssetsImage()/SetVisualAssetsImage()\", true)]\n            public static string phoneMediumTile140\n            {\n                get\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile140 is deprecated. Use GetVisualAssetsImage() instead.\");\n                }\n                set\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile140 is deprecated. Use SetVisualAssetsImage() instead.\");\n                }\n            }\n\n            [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n            [Obsolete(\"Use GetVisualAssetsImage()/SetVisualAssetsImage()\", true)]\n            public static string phoneMediumTile240\n            {\n                get\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile240 is deprecated. Use GetVisualAssetsImage() instead.\");\n                }\n                set\n                {\n                    throw new NotSupportedException(\"PlayerSettings.phoneMediumTile240 is deprecated. Use SetVisualAssetsImage() instead.\");","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/PlayerSettingsWSA.cs#L579-L615","documentation":"PlayerSettings.WSA.phoneMediumTile140 is a removed Windows Phone 8.1 visual-asset property whose accessor unconditionally throws NotSupportedException (the 1.4x phone scale is not a valid UWP asset size). Unity dropped the Windows Phone 8.1 image set when it unified on the Universal Windows Platform, so all phone* tile/icon/splash members were gutted and the error message points you at the replacement API. Visual assets must now be accessed through GetVisualAssetsImage(WSAImageType, WSAImageScale) / SetVisualAssetsImage(string, WSAImageType, WSAImageScale). The member is also annotated [Obsolete(\"Use GetVisualAssetsImage()/SetVisualAssetsImage()\", true)], so a direct reading (get) of phoneMediumTile140 is a compile-time error (CS0619); the runtime throw is only reachable through reflection or dynamic dispatch, in which case the message tells you to call GetVisualAssetsImage() instead.","triggerScenarios":"Executing the get accessor of PlayerSettings.WSA.phoneMediumTile140 (the deprecated region throws in both branches). For example: var path = PlayerSettings.WSA.phoneMediumTile140;  // get runs the accessor body, which immediately does `throw new NotSupportedException(...)`. Because [Obsolete(...,true)] turns the call into CS0619, normal compiled C# cannot reach it; the throw fires when the property is touched via reflection (PropertyInfo.GetValue/SetValue) or a dynamic/member-access path that bypasses the compiler check.","commonSituations":"Upgrading a project from a Unity version that still supported Windows Phone 8.1 (the phone* setters existed and worked); legacy editor scripts, build pipelines, or CI that configured phone tile/icon/splash assets; third-party plugins/extensions that enumerate or set PlayerSettings.WSA image members by name; reflection-based PlayerSettings automation; forum/wiki/Asset Store snippets copied before the UWP migration. The throw also surfaces during automated tests or tooling that round-trips every PlayerSettings property.","solutions":["Replace the get of phoneMediumTile140 with GetVisualAssetsImage(WSAImageType.UWPSquare150x150Logo, WSAImageScale._150), choosing the WSAImageType that matches the phone asset (UWPSquare150x150Logo) and a supported WSAImageScale.","There is no exact UWP equivalent for the 1.4x phone scale: regenerate the source image at a supported UWP scale (100/125/150/200/400, or target sizes 16/24/32/48/256) and use that WSAImageScale. The _140/_180/_240 enum values are themselves [Obsolete].","If the code reaches the property through reflection (e.g. enumerating PlayerSettings.WSA members), stop indexing phone* names; build an explicit name -> (WSAImageType, WSAImageScale) map and call Get/SetVisualAssetsImage instead.","Let Unity's API Updater rewrite the references (or fix every CS0619 by hand) so the obsolete members are never referenced anywhere in the project."],"exampleFix":"// before\nvar path = PlayerSettings.WSA.phoneMediumTile140; // throws NotSupportedException\n\n// after (UWP visual-asset API; pick the scale that matches your source image)\nvar path = PlayerSettings.WSA.GetVisualAssetsImage(WSAImageType.UWPSquare150x150Logo, WSAImageScale._150);","handlingStrategy":"validation","validationCode":"// Guard before touching any PlayerSettings.WSA image member by reflection:\n// refuse anything the engine has hard-deprecated with [Obsolete(..., true)].\nusing System;\nusing System.Linq;\nusing System.Reflection;\nusing UnityEditor;\n\nstatic bool IsSafeAssetMember(string propertyName)\n{\n    var prop = typeof(PlayerSettings.WSA).GetProperty(\n        propertyName, BindingFlags.Public | BindingFlags.Static);\n    if (prop == null) return false;\n    var obs = prop.GetCustomAttribute<ObsoleteAttribute>();\n    // true == treated as a compile error == always throws at runtime\n    return obs == null || obs.Error != true;\n}\n\n// usage:\n// if (IsSafeAssetMember(\"phoneSmallTile\")) { ... } else { use Get/SetVisualAssetsImage }","typeGuard":"// Reject any deprecated Windows Phone 8.1 visual-asset name before reflecting on it.\nstatic readonly System.Collections.Generic.HashSet<string> DeprecatedPhoneAssets =\n    new System.Collections.Generic.HashSet<string>(System.Linq.Enumerable.Range(0, 0)\n        .Select(_ => \"\")) { };\n\n// populate once from the removed phone* set:\n//   phoneAppIcon(,140,240), phoneSmallTile(,140,240), phoneMediumTile(,140,240),\n//   phoneWideTile(,140,240), phoneSplashScreenImage(Scale140/180), phoneSplashScreenImage\nstatic bool IsDeprecatedPhoneAsset(string name) =>\n    name != null && name.StartsWith(\"phone\", System.StringComparison.Ordinal);","tryCatchPattern":"// Only meaningful for reflection/dynamic access (direct use is CS0619).\ntry\n{\n    _ = typeof(PlayerSettings.WSA)\n            .GetProperty(\"phoneSmallTile\", BindingFlags.Public | BindingFlags.Static)\n            .GetValue(null, null);\n}\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"deprecated\"))\n{\n    // a hard-deprecated member: fall through to GetVisualAssetsImage/SetVisualAssetsImage\n    UnityEngine.Debug.LogWarning($\"Skipped deprecated PlayerSettings.WSA member: {ex.Message}\");\n}","preventionTips":["Never reference PlayerSettings.WSA.phoneMediumTile140; migrate it to Get/SetVisualAssetsImage with WSAImageType.UWPSquare150x150Logo.","Build against a UWP target and use only the supported WSAImageScale values (100/125/150/200/400, target 16/24/32/48/256).","Run Unity's API Updater on upgrade and resolve every CS0619 before running the editor.","If you reflect over PlayerSettings.WSA, filter out [Obsolete(Error = true)] members first (see IsSafeAssetMember).","Grep the project for `phoneAppIcon`, `phoneSmallTile`, `phoneMediumTile`, `phoneWideTile`, `phoneSplashScreen` and replace each hit."],"tags":["unity","playersettings-wsa","deprecation","windows-phone","notsupported","compile-error"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}