Title: System.IO.Pipelines missing from the TRUSTED_PLATFORM_ASSEMBLIES array · Issue #114 · PowerShell/PowerShell-Native · GitHub
Open Graph Title: System.IO.Pipelines missing from the TRUSTED_PLATFORM_ASSEMBLIES array · Issue #114 · PowerShell/PowerShell-Native
X Title: System.IO.Pipelines missing from the TRUSTED_PLATFORM_ASSEMBLIES array · Issue #114 · PowerShell/PowerShell-Native
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce When running some PowerShell command that needs System.IO.Pipelines remotely (so via wsmprov...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce When running some PowerShell command that needs Syst...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce When running some PowerShell command that needs Syst...
Opengraph URL: https://github.com/PowerShell/PowerShell-Native/issues/114
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"System.IO.Pipelines missing from the TRUSTED_PLATFORM_ASSEMBLIES array","articleBody":"### Prerequisites\n\n- [x] Write a descriptive title.\n- [x] Make sure you are able to repro it on the latest version\n- [x] Search the existing issues.\n\n### Steps to reproduce\n\nWhen running some PowerShell command that needs `System.IO.Pipelines` remotely (so via wsmprovhost.exe), it fails with a `FileNotFoundException`, because the file could not be located & loaded into the default ALC (Assembly Load Context). Of course, this could happen with other modules as well.\n\n**The file does exist & is in the right place, correct version.**\n\nThe problem seems to be that the ALC is initialized with `string.Empty` for `basePaths` (raised a separate issue item for that -> https://github.com/PowerShell/PowerShell/issues/27982)and also specifically `System.IO.Pipelines` is **missing** from `TRUSTED_PLATFORM_ASSEMBLIES` list, which is what I'm opening this issue for.\n\nhttps://github.com/PowerShell/PowerShell-Native/blob/2c55e8fc288e31ce72974ad783151b06049591c4/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp#L669\n\ne.g:\n```PowerShell\nPS C:\\> Invoke-Command -ComputerName srv-2025.skynet.lab -ConfigurationName powershell.7 -ScriptBlock {\n \n # We need to run something to trigger the loading of System.IO.Pipelines. Interacting with a repository using v3 APIs will trigger it while parsing the JSON (e.g: nuget.org).\n Find-PSResource -Name Newtonsoft.Json -Repository NuGet -Verbose\n}\n\nFind-PSResource: Could not load file or assembly 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n```\n\nRun this locally & remotely to confirm:\n```PowerShell\n[pscustomobject]@{\n ProcessPath = [Environment]::ProcessPath\n BaseDirectory = [AppContext]::BaseDirectory\n DepsFiles = [AppContext]::GetData('APP_CONTEXT_DEPS_FILES')\n HasPipelinesInTPA = (\n [AppContext]::GetData('TRUSTED_PLATFORM_ASSEMBLIES') -split ';'\n ).Where({ [IO.Path]::GetFileName($_) -eq 'System.IO.Pipelines.dll' }).Count -gt 0\n}\n```\n\nLOCAL:\n```PowerShell\nProcessPath : C:\\Program Files\\PowerShell\\7\\pwsh.exe \nBaseDirectory : C:\\Program Files\\PowerShell\\7\\\nDepsFile : C:\\Program Files\\PowerShell\\7\\pwsh.deps.json \nHasPipelinesInTPA : True\n```\n\nREMOTE:\n```PowerShell\nProcessPath : C:\\Windows\\system32\\wsmprovhost.exe\nBaseDirectory :\nDepsFiles :\nHasPipelinesInTPA : False\nPSComputerName : srv-2025.skynet.lab\n```\n\nThis is the flow that leads to the problem:\n -> `PSResourceGet` V3ServerAPICalls\n -> `System.Text.Json` loaded to parse .json response\n -> [PooledByteBufferWriter](https://relativityapiexplorer.azurewebsites.net/packages/System.Text.Json/10.0.11/lib/net10.0/System.Text.Json.dll/System.Text.Json/PooledByteBufferWriter?code=true) from `System.Text.Json` has a dependency (extends) on [PipeWriter](https://learn.microsoft.com/en-us/dotnet/api/system.io.pipelines.pipewriter?view=net-10.0), which is coming from `System.IO.Pipelines`\n -> bind `System.IO.Pipelines` v10.0.0.0 — token cc7b13ffcd2ddd51\n -> not in ALC already\n -> empty `basePaths` / `__probingPaths`\n -> not in `TRUSTED_PLATFORM_ASSEMBLIES`\n -> fallback as last resort to legacy GAC / MSIL (not found there either, but not expected to be there anyway)\n -> `FileNotFoundException`\n\nIf you manually import the module in the ALC, before running the command, it all works fine.\ne.g:\n```PowerShell\nInvoke-Command -ComputerName srv-2025.skynet.lab -ConfigurationName powershell.7 -ScriptBlock {\n \n [System.Runtime.Loader.AssemblyLoadContext]::Default.LoadFromAssemblyPath((Join-Path $PSHOME 'System.IO.Pipelines.dll'))\n\n # We need to run something to trigger the loading of System.IO.Pipelines. Interacting with a repository using v3 APIs will trigger it while parsing the JSON (e.g: nuget.org).\n Find-PSResource -Name Newtonsoft.Json -Repository NuGetV3Lab\n}\n\n\nGAC Version Location PSComputerName\n--- ------- -------- --------------\nFalse v4.0.30319 C:\\Program Files\\PowerShell\\7\\System.IO.Pipelin… srv-2025.skynet.lab\n\nAuthor : James Newton-King\n...\nName : Newtonsoft.Json\nProjectUri : https://www.newtonsoft.com/json\n...\n```\n\nOf course, if basePaths (aka ALC.__probingPaths) wouldn't be empty, then it would also work fine. But for that, I raised the other issue.\n```\n2068206b0e8(System.Management.Automation.PowerShellAssemblyLoadContext)._probingPaths\n[raw] 00000206820239d8 System.String[] Length: 0\n```\n\n### Expected behavior\n\nThe ALC loads System.IO.Pipelines & the command runs successfully.\n\n\n### Actual behavior\n\n```console\nFind-PSResource: Could not load file or assembly 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n```\n\n### Error details\n\n```console\nOriginInfo : srv-2025.skynet.lab\nException :\n Type : System.Management.Automation.RemoteException\n SerializedRemoteException : System.IO.FileNotFoundException: Could not load file or assembly\n'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the\nfile specified.\n File name: 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral,\nPublicKeyToken=cc7b13ffcd2ddd51'\n at System.Text.Json.JsonDocument.Dispose()\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1528\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1498\n SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo\n ErrorRecord :\n Exception :\n Type : System.Management.Automation.RemoteException\n SerializedRemoteException : System.IO.FileNotFoundException: Could not load file or assembly\n'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the\nfile specified.\n File name: 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral,\nPublicKeyToken=cc7b13ffcd2ddd51'\n at System.Text.Json.JsonDocument.Dispose()\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1528\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1498\n SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo\n ErrorRecord :\n Exception :\n Type : System.Management.Automation.RemoteException\n SerializedRemoteException : System.IO.FileNotFoundException: Could not load file or assembly\n'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the\nfile specified.\n File name: 'System.IO.Pipelines, Version=10.0.0.0,\nCulture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\n at System.Text.Json.JsonDocument.Dispose()\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1528\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1498\n SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo\n ErrorRecord :\n Exception :\n Type : System.Management.Automation.RemoteException\n SerializedRemoteException : System.IO.FileNotFoundException: Could not load file or\nassembly 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot\nfind the file specified.\n File name: 'System.IO.Pipelines, Version=10.0.0.0,\nCulture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\n at System.Text.Json.JsonDocument.Dispose()\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1528\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1498\n SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo\n ErrorRecord :\n Exception :\n Type : System.Management.Automation.RemoteException\n SerializedRemoteException : System.IO.FileNotFoundException: Could not load\nfile or assembly 'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system\ncannot find the file specified.\n File name: 'System.IO.Pipelines,\nVersion=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'\n at System.Text.Json.JsonDocument.Dispose()\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1528\n at\nMicrosoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls.GetJsonElementArr(String request, String propertyName,\nInt32& totalHits, ErrorRecord& errRecord) in C:\\__w\\1\\s\\PSResourceGet\\src\\code\\V3ServerAPICalls.cs:line 1498\n SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo\n ErrorRecord : …\n Message : Could not load file or assembly\n'System.IO.Pipelines, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the\nfile specified.\n HResult : -2146233087\n TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls\n CategoryInfo : InvalidResult:\n(Microsoft.PowerShel…ts.V3ServerAPICalls:V3ServerAPICalls) [Find-PSResource], FileNotFoundException\n FullyQualifiedErrorId :\nGetResponsesFromRegistrationsResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource\n ScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 32\n Message : Could not load file or assembly 'System.IO.Pipelines,\nVersion=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n HResult : -2146233087\n TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls\n CategoryInfo : InvalidResult:\n(Microsoft.PowerShel…ts.V3ServerAPICalls:V3ServerAPICalls) [Find-PSResource], FileNotFoundException\n FullyQualifiedErrorId :\nGetResponsesFromRegistrationsResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource\n ScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 32\n Message : Could not load file or assembly 'System.IO.Pipelines,\nVersion=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n HResult : -2146233087\n TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls\n CategoryInfo : InvalidResult: (Microsoft.PowerShel…ts.V3ServerAPICalls:V3ServerAPICalls)\n[Find-PSResource], FileNotFoundException\n FullyQualifiedErrorId :\nGetResponsesFromRegistrationsResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource\n ScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 32\n Message : Could not load file or assembly 'System.IO.Pipelines, Version=10.0.0.0,\nCulture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n HResult : -2146233087\n TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls\n CategoryInfo : InvalidResult: (Microsoft.PowerShel…ts.V3ServerAPICalls:V3ServerAPICalls)\n[Find-PSResource], FileNotFoundException\n FullyQualifiedErrorId :\nGetResponsesFromRegistrationsResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource\n ScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 32\n Message : Could not load file or assembly 'System.IO.Pipelines, Version=10.0.0.0,\nCulture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.\n HResult : -2146233087\nTargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.V3ServerAPICalls\nCategoryInfo : InvalidResult: (Microsoft.PowerShel…ts.V3ServerAPICalls:V3ServerAPICalls) [Find-PSResource],\nFileNotFoundException\nFullyQualifiedErrorId :\nGetResponsesFromRegistrationsResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource\nScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 32\n```\n\n### Environment data\n\n`$PSVersionTable` inserted in the ScriptBlock. I cannot test with PowerShell 7.7 preview, because it does not come with a `pwrshplugin.dll` & `PSSessionConfiguration`.\n\nNevertheless, the problematic code is present in the latest master branch.\n\n```PowerShell\nName Value\n---- -----\nPlatform Win32NT\nPSRemotingProtocolVersion\nPSEdition Core\nOS Microsoft Windows 10.0.26100\nPSVersion 7.6.5\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nGitCommitId 7.6.5\nWSManStackVersion 3.0\nSerializationVersion 1.1.0.1\n```\n\n### Version\n\n7.6.5\n\n### Visuals\n\nFail:\n\u003cimg width=\"1054\" height=\"133\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d31bb78b-7efa-4bb6-b000-cd96993cf93a\" />\n\nWorks (if \"preloading\" in the ALC):\n\u003cimg width=\"1051\" height=\"291\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/18857c95-4111-4c9e-9a98-5dca87c20bd6\" />","author":{"url":"https://github.com/mariuselix","@type":"Person","name":"mariuselix"},"datePublished":"2026-09-08T10:05:35Z","url":"https://github.com/PowerShell/PowerShell-Native/issues/114"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:e7d124d9-f635-0756-5292-d3e5d92c9e90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C9C:1A5B7B:2269B2:2D9092:6AFD0311 |
| html-safe-nonce | 6754fe7f11b89f9f4cff07559a6a69746c5e8e4bc8822a48842b9e4226d21977 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzlDOjFBNUI3QjoyMjY5QjI6MkQ5MDkyOjZBRkQwMzExIiwidmlzaXRvcl9pZCI6IjM3NTg3ODI4MjQ2NDgwODIxOTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81a0b5ccf22d7c8045b591c9ff6e10cc9efde0c079f7d5f48059accbc9b069d0 |
| hovercard-subject-tag | issue:5385294074 |
| 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/PowerShell-Native/114/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb46574be227807fb4a55c995db3456f80caf4b8fb363f95605fa2d6ad7aae5b/PowerShell/PowerShell-Native/issues/114 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb46574be227807fb4a55c995db3456f80caf4b8fb363f95605fa2d6ad7aae5b/PowerShell/PowerShell-Native/issues/114 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest version Search the existing issues. Steps to reproduce When running some PowerShell command that needs Syst... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mariuselix |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8fd5a24ae29aa78df114eaaf1f9a839e8c3b7c0d27549e4f54678bb7cf3166d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell-Native git https://github.com/PowerShell/PowerShell-Native.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 134639849 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell-Native |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 134639849 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell-Native |
| 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 | dd0990b833f227378ab84f1d9519db1a04660550 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width