The docs for Socket.SendFile(string) state that the string argument is allowed to be null, and on .NET Framework when it's null, the operation executes fine, sending nothing. However, in .NET 5 the string argument is annotated as non-nullable, and on Windows it throws an exception when null is provided, as in #42529.