dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
719 stars 1.56k forks source link

The sample code is wrong (multiple issues) #10176

Open rz53555 opened 2 months ago

rz53555 commented 2 months ago

Type of issue

Code doesn't work

Description

(https://stackoverflow.com/questions/78803951/is-the-tobase64transform-code-sample-wrong)

  1. Members.cs file needs to have Copy to Output Directory set to Copy always, which is not stated in the article
  2. if (!base64Transform.CanTransformMultipleBlocks) always fails
  3. the length of the input block (always 3 bytes or fewer) is not being passed correctly
  4. the code suggests file members.enc, but the comment suggests file membersvcs.enc

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.tobase64transform?view=net-8.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Security.Cryptography/ToBase64Transform.xml

Document Version Independent Id

cf28e95d-fa5a-7075-cd97-5eb195e27acc

Article author

@dotnet-bot

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones