Title: SetValue for nested field throws "Unable to cast object" · Issue #2170 · PowerShell/PowerShellEditorServices · GitHub
Open Graph Title: SetValue for nested field throws "Unable to cast object" · Issue #2170 · PowerShell/PowerShellEditorServices
X Title: SetValue for nested field throws "Unable to cast object" · Issue #2170 · PowerShell/PowerShellEditorServices
Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this issue is with PowerShell Editor Services...
Open Graph Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
X Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
Opengraph URL: https://github.com/PowerShell/PowerShellEditorServices/issues/2170
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SetValue for nested field throws \"Unable to cast object\"","articleBody":"### Prerequisites\n\n- [X] I have written a descriptive issue title.\n- [X] I have searched all [_open and closed_ issues](https://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue) to ensure it has not already been reported.\n- [X] I have read the [troubleshooting](https://github.com/PowerShell/vscode-powershell/blob/main/docs/troubleshooting.md) guide.\n- [X] I am sure this issue is with _PowerShell Editor Services itself_ and does not reproduce in a standalone [PowerShell](https://github.com/PowerShell/PowerShell/issues/new/choose) instance, and is not an issue with my editor.\n- [X] I have verified that I am using the latest version of PowerShell Editor Services.\n- [x] If this is a security issue, I have read the [security issue reporting guidance](https://github.com/PowerShell/vscode-powershell/blob/main/SECURITY.md).\n\n### Summary\n\nSetting nested field value throws\r\n`Unable to cast object of type 'Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableDetails' to type 'Microsoft.PowerShell.EditorServices.Services.DebugAdapter.VariableContainerDetails'.`\r\n\r\n\r\n\r\nThe code below should be causing the problem.\r\n\r\nhttps://github.com/PowerShell/PowerShellEditorServices/blob/41fce39f491d5d351b4ac5864e89857ec070e107/src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs#L390\r\n\r\n\n\n### PowerShell Version\n\n```console\nName Value\r\n---- -----\r\nPSVersion 7.4.3\r\nPSEdition Core\r\nGitCommitId 7.4.3\r\nOS Microsoft Windows 10.0.19045\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\n```\n\n\n### Editor Version\n\n```console\nVisual Studio Code\r\nVersion: 1.91.1 (user setup)\r\nCommit: f1e16e1e6214d7c44d078b1f0607b2388f29d729\r\nDate: 2024-07-09T22:06:49.809Z\r\nElectron: 29.4.0\r\nElectronBuildId: 9728852\r\nChromium: 122.0.6261.156\r\nNode.js: 20.9.0\r\nV8: 12.2.281.27-electron.0\r\nOS: Windows_NT x64 10.0.19045\n```\n\n\n### PowerShell Editor Services Version\n\n```console\nMajor Minor Build Revision\r\n----- ----- ----- --------\r\n3 20 1 0\n```\n\n\n### Steps to Reproduce\n\n```\r\n$val = [PSCustomObject]@{\r\n NestedField = \"Test\"\r\n}\r\nWrite-Host $val\r\nwhile ($true) {\r\n Write-Host $val \r\n}\r\n```\r\n\r\n1) Put breakpoint on line 4 (`Write-Host $val`)\r\n2) Start debugging\r\n3) Open \"Local\" scope in Variables tab\r\n4) Find $val and change NestedField value\n\n### Visuals\n\n_No response_\n\n### Logs\n\n_No response_","author":{"url":"https://github.com/Fantoom","@type":"Person","name":"Fantoom"},"datePublished":"2024-08-01T12:47:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2170/PowerShellEditorServices/issues/2170"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d78effb8-e2c4-59ef-2568-cbfccf301fb9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95C8:5182B:10B900:1703D9:6A583DD2 |
| html-safe-nonce | 2dfa1eec39031ab013cda7d78448e591c651f2974b66e85590c76b63478f6356 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUM4OjUxODJCOjEwQjkwMDoxNzAzRDk6NkE1ODNERDIiLCJ2aXNpdG9yX2lkIjoiMzY4MzY0MzkxNzk4MTk5MDM1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5f136190793f6bc082d085a67412deda4e7846632a75b8b530954ca530ae9dd1 |
| hovercard-subject-tag | issue:2442367834 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShellEditorServices/2170/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8cf6fe5d9b42f3bc402d036ba7a8f054517f8d33cabff704fdefc9ca17e10795/PowerShell/PowerShellEditorServices/issues/2170 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8cf6fe5d9b42f3bc402d036ba7a8f054517f8d33cabff704fdefc9ca17e10795/PowerShell/PowerShellEditorServices/issues/2170 |
| og:image:alt | Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Fantoom |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShellEditorServices git https://github.com/PowerShell/PowerShellEditorServices.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 36031537 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShellEditorServices |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36031537 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShellEditorServices |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width