Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving away from BinaryFormatter #6826

Closed
highlyunavailable opened this issue Nov 11, 2020 · 6 comments
Closed

Moving away from BinaryFormatter #6826

highlyunavailable opened this issue Nov 11, 2020 · 6 comments
Assignees
Labels
stale Issues with no activity for the past 6 months

Comments

@highlyunavailable
Copy link
Contributor

I'm testing upgrading my Orleans app to dotnet 5.0 and I was getting errors about using BinaryFormatter. I can of course switch the formatter and am doing so but this may be something to keep in mind for near-future:

https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide

@ReubenBond
Copy link
Member

Hi @highlyunavailable, thanks for reporting.

There is a workaround for now:

<PropertyGroup>
    <TargetFramework>netcoreapp5.0</TargetFramework>
    <!-- Warning: setting the below switch is *NOT* recommended in web apps -->
    <!-- See: https://aka.ms/binaryformatter -->
    <!-- See: https://github.com/dotnet/orleans/issues/6805 -->
    <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

BinaryFormatter is used only as a fallback in Orleans (which still means it has that lack of security attributes, of course), mostly for serializing exceptions. We're looking into other alternatives for exception serialization.

Cross-referencing another issue on this: #6805

@ReubenBond ReubenBond self-assigned this Nov 11, 2020
@highlyunavailable
Copy link
Contributor Author

Thank you!

@ReubenBond
Copy link
Member

We merged #6922 to completely remove BinaryFormatter. Thanks again, @highlyunavailable

@turowicz
Copy link

@ReubenBond is there a release we can expect that will contain this fix?

@ReubenBond
Copy link
Member

We could potentially remove it for net5.0 targets. The issue is with breaking compatibility. Traditionally, major version revisions are the only time where that would be at all acceptable. So if we did exclude it for net5.0, we would also need a way to bring it back via an optional package or potentially a switch.

There's a workaround mentioned above

@turowicz
Copy link

turowicz commented Mar 24, 2021

@ReubenBond Thanks, we are using the workaround,. Unfortunately we have web apps, so its not recommended to use it.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 25, 2021
@ghost ghost added the stale Issues with no activity for the past 6 months label Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale Issues with no activity for the past 6 months
Projects
None yet
Development

No branches or pull requests

3 participants