Title: BinaryFormatter disabled in .Net 8 breaks Out-HTMLView/New-HTML/etc · Issue #389 · EvotecIT/PSWriteHTML · GitHub
Open Graph Title: BinaryFormatter disabled in .Net 8 breaks Out-HTMLView/New-HTML/etc · Issue #389 · EvotecIT/PSWriteHTML
X Title: BinaryFormatter disabled in .Net 8 breaks Out-HTMLView/New-HTML/etc · Issue #389 · EvotecIT/PSWriteHTML
Description: While testing PowerShell 7.4-preview4, reports built using PSWriteHTML v0.0.190 no longer work. Expected behavior Get-Process | Out-HTMLView returns without error Actual behavior Copy-Dictionary: Exception calling "Serialize" with "2" ar...
Open Graph Description: While testing PowerShell 7.4-preview4, reports built using PSWriteHTML v0.0.190 no longer work. Expected behavior Get-Process | Out-HTMLView returns without error Actual behavior Copy-Dictionary: E...
X Description: While testing PowerShell 7.4-preview4, reports built using PSWriteHTML v0.0.190 no longer work. Expected behavior Get-Process | Out-HTMLView returns without error Actual behavior Copy-Dictionary: E...
Opengraph URL: https://github.com/EvotecIT/PSWriteHTML/issues/389
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BinaryFormatter disabled in .Net 8 breaks Out-HTMLView/New-HTML/etc","articleBody":"While testing [PowerShell 7.4-preview4](https://github.com/PowerShell/PowerShell/releases/tag/v7.4.0-preview.4), reports built using PSWriteHTML v0.0.190 no longer work.\r\n\r\n### Expected behavior\r\n`Get-Process | Out-HTMLView` returns without error\r\n\r\n### Actual behavior\r\n`Copy-Dictionary: Exception calling \"Serialize\" with \"2\" argument(s): \"BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.\"`\r\n\r\nFollowing the rabbit-hole I dug up;\r\n* 7.4-preview4 is updated to .NET 8 Preview 4 https://github.com/PowerShell/PowerShell/pull/19696\r\n* the binaryserializer is now disabled https://learn.microsoft.com/en-us/dotnet/core/compatibility/serialization/8.0/binaryformatter-disabled\r\n* if I replace the `Copy-Dictionary` function w/ the clixml serializer example then my report builts and `Out-HTMLView` works (https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-hashtable?view=powershell-7.3)\r\n\r\n```\r\n\r\n# function Copy-Dictionary { \r\n# [alias('Copy-Hashtable', 'Copy-OrderedHashtable')]\r\n# [cmdletbinding()]\r\n# param(\r\n# [System.Collections.IDictionary] $Dictionary\r\n# )\r\n# # create a deep-clone of an object\r\n# $ms = [System.IO.MemoryStream]::new()\r\n# $bf = [System.Runtime.Serialization.Formatters.Binary.BinaryFormatter]::new()\r\n# $bf.Serialize($ms, $Dictionary)\r\n# $ms.Position = 0\r\n# $clone = $bf.Deserialize($ms)\r\n# $ms.Close()\r\n# $clone\r\n# }\r\nfunction Copy-Dictionary {\r\n [alias('Copy-Hashtable', 'Copy-OrderedHashtable')]\r\n [cmdletbinding()]\r\n param(\r\n [System.Collections.IDictionary] $Dictionary\r\n )\r\n $clone = [System.Management.Automation.PSSerializer]::Serialize($Dictionary, [int32]::MaxValue)\r\n return [System.Management.Automation.PSSerializer]::Deserialize($clone)\r\n}\r\n```\r\n","author":{"url":"https://github.com/crlogic","@type":"Person","name":"crlogic"},"datePublished":"2023-07-02T12:16:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/389/PSWriteHTML/issues/389"}
| 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:abb64e27-49ab-7817-7751-add1967b0f76 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAAA:E0FB:21E81D4:2D71C45:6A65306E |
| html-safe-nonce | 0ef0cdab58c880f2800e2242219ebdb05d2a04dc015a7f801888f278d5122797 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUFBOkUwRkI6MjFFODFENDoyRDcxQzQ1OjZBNjUzMDZFIiwidmlzaXRvcl9pZCI6IjIzOTc1NTExNjcwNDI1NjQyMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 668fa1ea8e7f25485ba4155eef97ccdc57ccc8b2b56dcb4e197b43c9fa8bc178 |
| hovercard-subject-tag | issue:1784612565 |
| 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/EvotecIT/PSWriteHTML/389/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04ab16832af7a94f73c37d6b9f452c9347374da3bf03d70ec988c13b1d3d0fdd/EvotecIT/PSWriteHTML/issues/389 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04ab16832af7a94f73c37d6b9f452c9347374da3bf03d70ec988c13b1d3d0fdd/EvotecIT/PSWriteHTML/issues/389 |
| og:image:alt | While testing PowerShell 7.4-preview4, reports built using PSWriteHTML v0.0.190 no longer work. Expected behavior Get-Process | Out-HTMLView returns without error Actual behavior Copy-Dictionary: E... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | crlogic |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| go-import | github.com/EvotecIT/PSWriteHTML git https://github.com/EvotecIT/PSWriteHTML.git |
| octolytics-dimension-user_id | 15376314 |
| octolytics-dimension-user_login | EvotecIT |
| octolytics-dimension-repository_id | 161933895 |
| octolytics-dimension-repository_nwo | EvotecIT/PSWriteHTML |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161933895 |
| octolytics-dimension-repository_network_root_nwo | EvotecIT/PSWriteHTML |
| 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 | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width