Skip to content

Properly detect availability of BinaryFormatter#121

Open
Martin-Molinero wants to merge 1 commit into
masterfrom
cherry/detect-binaryformatter
Open

Properly detect availability of BinaryFormatter#121
Martin-Molinero wants to merge 1 commit into
masterfrom
cherry/detect-binaryformatter

Conversation

@Martin-Molinero

Copy link
Copy Markdown
Member

Cherry-pick from upstream pythonnet/pythonnet: avoids throwing when BinaryFormatter is unavailable (it's removed/disabled on modern .NET, incl. net10). Adds a DefaultFormatterFactory that probes BinaryFormatter once and falls back to NoopFormatter, plus a settable FormatterFactory.

Conflict note: RuntimeData.cs diverged in this fork. Resolved by taking the upstream factory and wiring this fork's CreateFormatter() fallback to FormatterFactory() (it previously did new BinaryFormatter() directly, which is what would throw on net10). The FormatterType override path is preserved. Builds clean.

Relevant since this fork targets net10 where BinaryFormatter serialization is no longer supported.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants