Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Stream sample in Additional files documentation #10976

Merged
merged 1 commit into from
May 16, 2016

Conversation

svick
Copy link
Contributor

@svick svick commented Apr 29, 2016

The original code had two issues:

  • The StreamWriter closes the underlying MemoryStream, so XDocument can't read from it.
  • After writing, the MemoryStream stays at its end, so XDocument wouldn't read anything.

This change fixes both issues.

I have also mentioned converting to string using ToString in the description before the example. Though IMHO, in this specific case, calling ToString() and then using XDocument.Parse() instead would be preferable.

Also mentioned converting to string using ToString
@svick
Copy link
Contributor Author

svick commented Apr 29, 2016

CC: @tmeschter

@Pilchie Pilchie added Area-Analyzers Community The pull request was submitted by a contributor who is not a Microsoft employee. labels May 15, 2016
@Pilchie
Copy link
Member

Pilchie commented May 15, 2016

Tag @dotnet/roslyn-analysis Can you take a look?

@tmeschter
Copy link
Contributor

LGTM.

@mavasani
Copy link
Contributor

👍 Thanks @svick

@mavasani mavasani merged commit cd74221 into dotnet:master May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers cla-already-signed Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants