dotnet / dotnet/dotnet-api-docs

The sample code is wrong (multiple issues)

Open
#10,176 2 comments 1 reaction 0 assignees View on GitHub
area-System.Security Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Type of issue

Code doesn't work

### Description

[(https://stackoverflow.com/questions/78803951/is-the-tobase64transform-code-sample-wrong)](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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.