Skip to content

Default EnableUnsafeBinaryFormatterSerialization and EnableUnsafeUTF7Encoding in trimmed applications#18812

Merged
eerhardt merged 1 commit into
dotnet:mainfrom
eerhardt:Fix14475
Jul 9, 2021
Merged

Default EnableUnsafeBinaryFormatterSerialization and EnableUnsafeUTF7Encoding in trimmed applications#18812
eerhardt merged 1 commit into
dotnet:mainfrom
eerhardt:Fix14475

Conversation

@eerhardt
Copy link
Copy Markdown
Member

@eerhardt eerhardt commented Jul 8, 2021

Fix #14475

FYI - @jkotas

@eerhardt eerhardt requested review from pgovind and sbomer July 8, 2021 21:30
@ghost
Copy link
Copy Markdown

ghost commented Jul 8, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Copy link
Copy Markdown

@pgovind pgovind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaults look good to me.

@sbomer
Copy link
Copy Markdown
Member

sbomer commented Jul 8, 2021

#14475 mentions that EnableUnsafeUTF7Encoding is already turned off by default, but I only see it turned off in the blazor SDK. Should that one be defaulted in the .NET SDK?

@eerhardt
Copy link
Copy Markdown
Member Author

eerhardt commented Jul 8, 2021

#14475 mentions that EnableUnsafeUTF7Encoding is already turned off by default, but I only see it turned off in the blazor SDK. Should that one be defaulted in the .NET SDK?

It's value is defaulted to false in the runtime if it isn't specified in the runtimeconfig.json. So there's really no reason to default again in the .NET SDK. There's no behavior difference, and all we get is an extra, unnecessary entry in the runtimeconfig.json.

The value we get out of this change (set it during PublishTrimmed=true) is that the linker sees its value, and trims away the UTF7 code in the runtime.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default values for feature switches in trimmed console apps

4 participants