René's URL Explorer Experiment


Title: BinaryFormatter serialization and deserialization warning which throws an error in .net8 · Issue #2282 · pythonnet/pythonnet · GitHub

Open Graph Title: BinaryFormatter serialization and deserialization warning which throws an error in .net8 · Issue #2282 · pythonnet/pythonnet

X Title: BinaryFormatter serialization and deserialization warning which throws an error in .net8 · Issue #2282 · pythonnet/pythonnet

Description: Environment Pythonnet version: 3.0.3 Python version: 3.9 Operating System: Windows 11 .NET Runtime: .net8 (release version 16/11/23) Details When shutting down the the PythonEngine via a Dispose method on the impermentation class, the er...

Open Graph Description: Environment Pythonnet version: 3.0.3 Python version: 3.9 Operating System: Windows 11 .NET Runtime: .net8 (release version 16/11/23) Details When shutting down the the PythonEngine via a Dispose me...

X Description: Environment Pythonnet version: 3.0.3 Python version: 3.9 Operating System: Windows 11 .NET Runtime: .net8 (release version 16/11/23) Details When shutting down the the PythonEngine via a Dispose me...

Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2282

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BinaryFormatter serialization and deserialization warning which throws an error in .net8","articleBody":"### Environment\r\n\r\n-   Pythonnet version: 3.0.3\r\n-   Python version: 3.9\r\n-   Operating System: Windows 11\r\n-   .NET Runtime: .net8 (release version 16/11/23)\r\n\r\n### Details\r\n\r\n-   When shutting down the the PythonEngine via a Dispose method on the impermentation class, the error occurs at the PythonEngine.Shutdown(); method and throws the error System.NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application (see trace below). The same code worked in .net7 without any issues, the error message leads to this description\r\n- \r\n- https://learn.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide\r\n- \r\n- Proir to the Shutdown error the pythonnet works correctly and calls python functions and returns the expected results\r\n- \r\n- The resolution is to add \u003cEnableUnsafeBinaryFormatterSerialization\u003etrue\u003c/EnableUnsafeBinaryFormatterSerialization\u003e to the .csproj file\r\n-     \u003cPropertyGroup\u003e\r\n        \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\r\n        \u003cEnableUnsafeBinaryFormatterSerialization\u003etrue\u003c/EnableUnsafeBinaryFormatterSerialization\u003e\r\n       \u003c/PropertyGroup\u003e\r\n\r\n\r\n\r\n    _TODO_\r\n\r\n\r\n- _logger.Log is to to trace the point of failure  \r\n- _logger.Log(LogLevel.Error, \"Shutting down Python engine\"); runs \r\n- it crashes at the PythonEngine.Shutdown(); method \r\n- _logger.Log(LogLevel.Error, \"Python engine shut down\"); does not run\r\n\r\n\r\n    private void Dispose(bool disposing)\r\n    {\r\n        _logger.Log(LogLevel.Error, \"Dispose\");\r\n        if (_disposed) return;\r\n        if (disposing)\r\n        {\r\n            _logger.Log(LogLevel.Error, \"Shutting down Python engine\");\r\n            PythonEngine.Shutdown();\r\n            _logger.Log(LogLevel.Error, \"Python engine shut down\");\r\n        }\r\n        _disposed = true;\r\n    }\r\n\r\n```python\r\n    print('TODO')\r\n```\r\n\r\n-   System.NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatt...\r\n\r\nSystem.NotSupportedException\r\nBinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.\r\n   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)\r\n   at Python.Runtime.RuntimeData.Stash()\r\n   at Python.Runtime.Runtime.Shutdown()\r\n   at Python.Runtime.PythonEngine.Shutdown()\r\n   at EcgAi.Training.Infrastructure.Python.PythonEnvironment.Dispose(Boolean disposing) in C:\\Data\\Rider\\EcgAi.Training\\Src\\EcgAi.Training.Infrastructure.Python\\PythonEnvironment.cs:line 113\r\n   at EcgAi.Training.Infrastructure.Python.PythonEnvironment.Dispose() in xxxxxxxxxxxxxxxxxxxxxxxxx\r\n\r\n```python\r\n    print('TODO')\r\n```\r\n","author":{"url":"https://github.com/RobertClapham","@type":"Person","name":"RobertClapham"},"datePublished":"2023-11-16T12:01:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/2282/pythonnet/issues/2282"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:afee7e68-b813-8900-c26f-83aeead846ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id986C:26FE0E:30E9DD4:31901C8:69702DC7
html-safe-nonce6c76916e42f8cf4a14a8900b67c75a5a1bf891e40558b146ba1c405ed3d5616f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODZDOjI2RkUwRTozMEU5REQ0OjMxOTAxQzg6Njk3MDJEQzciLCJ2aXNpdG9yX2lkIjoiMzcyMzE3NDA1ODIyNDc5MDk4MyIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9
visitor-hmac69a0390ebdee332936213f6c542a70c9cb0f9dc7f49d65bd1a07a43d1650ee0a
hovercard-subject-tagissue:1996704381
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/2282/issue_layout
twitter:imagehttps://opengraph.githubassets.com/82fb8315c6059a65dcdc20e6ed38ec2d9e78aa182e45f8bfc3698c37fe8b6e55/pythonnet/pythonnet/issues/2282
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/82fb8315c6059a65dcdc20e6ed38ec2d9e78aa182e45f8bfc3698c37fe8b6e55/pythonnet/pythonnet/issues/2282
og:image:altEnvironment Pythonnet version: 3.0.3 Python version: 3.9 Operating System: Windows 11 .NET Runtime: .net8 (release version 16/11/23) Details When shutting down the the PythonEngine via a Dispose me...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRobertClapham
hostnamegithub.com
expected-hostnamegithub.com
None01fa379f5de85ef8e791d09724e69709ce9eb9595278316e0a921312dc88e0bc
turbo-cache-controlno-preview
go-importgithub.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git
octolytics-dimension-user_id6050430
octolytics-dimension-user_loginpythonnet
octolytics-dimension-repository_id14748123
octolytics-dimension-repository_nwopythonnet/pythonnet
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14748123
octolytics-dimension-repository_network_root_nwopythonnet/pythonnet
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedda91974c069382b0dfa47b2da7e28bd061c8331
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pythonnet/pythonnet/issues/2282#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpythonnet%2Fpythonnet%2Fissues%2F2282
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpythonnet%2Fpythonnet%2Fissues%2F2282
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pythonnet%2Fpythonnet
Reloadhttps://github.com/pythonnet/pythonnet/issues/2282
Reloadhttps://github.com/pythonnet/pythonnet/issues/2282
Reloadhttps://github.com/pythonnet/pythonnet/issues/2282
pythonnet https://github.com/pythonnet
pythonnethttps://github.com/pythonnet/pythonnet
Notifications https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Fork 770 https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Star 5.4k https://github.com/login?return_to=%2Fpythonnet%2Fpythonnet
Code https://github.com/pythonnet/pythonnet
Issues 155 https://github.com/pythonnet/pythonnet/issues
Pull requests 18 https://github.com/pythonnet/pythonnet/pulls
Discussions https://github.com/pythonnet/pythonnet/discussions
Actions https://github.com/pythonnet/pythonnet/actions
Projects 0 https://github.com/pythonnet/pythonnet/projects
Wiki https://github.com/pythonnet/pythonnet/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/pythonnet/pythonnet/security
Please reload this pagehttps://github.com/pythonnet/pythonnet/issues/2282
Insights https://github.com/pythonnet/pythonnet/pulse
Code https://github.com/pythonnet/pythonnet
Issues https://github.com/pythonnet/pythonnet/issues
Pull requests https://github.com/pythonnet/pythonnet/pulls
Discussions https://github.com/pythonnet/pythonnet/discussions
Actions https://github.com/pythonnet/pythonnet/actions
Projects https://github.com/pythonnet/pythonnet/projects
Wiki https://github.com/pythonnet/pythonnet/wiki
Security https://github.com/pythonnet/pythonnet/security
Insights https://github.com/pythonnet/pythonnet/pulse
New issuehttps://github.com/login?return_to=https://github.com/pythonnet/pythonnet/issues/2282
New issuehttps://github.com/login?return_to=https://github.com/pythonnet/pythonnet/issues/2282
BinaryFormatter serialization and deserialization warning which throws an error in .net8https://github.com/pythonnet/pythonnet/issues/2282#top
https://github.com/RobertClapham
https://github.com/RobertClapham
RobertClaphamhttps://github.com/RobertClapham
on Nov 16, 2023https://github.com/pythonnet/pythonnet/issues/2282#issue-1996704381
https://learn.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guidehttps://learn.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide
https://aka.ms/binaryformatthttps://aka.ms/binaryformatt
https://aka.ms/binaryformatterhttps://aka.ms/binaryformatter
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.