dotnet / dotnet/sdk

Remove EnableUnsafeBinaryFormatterSerialization setting in default runtimeconfig.json

Open
#43,228 1 comment 1 reaction 0 assignees View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
We are always adding

```json
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
```

to the `runtimeconfig.json` file of a .NET 9 app.

This setting doesn't really do anything anymore now that https://devblogs.microsoft.com/dotnet/binaryformatter-removed-from-dotnet-9/.

### To Reproduce
1. `dotnet new console`
2. `dotnet build`
3. Inspect the `bin\Debug\net9.0` output

### Expected result

The `runtimeconfig.json` file doesn't contain a setting for EnableUnsafeBinaryFormatterSerialization.

### Actual result

The `runtimeconfig.json` file contains:

```json
{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0-preview.7.24405.7"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
```

cc @adamsitnik @GrabYourPitchforks @terrajobst

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.