Skip to content

The sample code is wrong (multiple issues) #10176

Open
@rz53555

Description

@rz53555

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.SecurityIssues related to security practices for .NET developers.untriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions