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

Extra Semicolon in Example #44489

Open
gggustafson opened this issue Jan 22, 2025 · 0 comments
Open

Extra Semicolon in Example #44489

gggustafson opened this issue Jan 22, 2025 · 0 comments
Labels
⌚ Not Triaged Not triaged

Comments

@gggustafson
Copy link

Type of issue

Code doesn't work

Description

In the example

// Construct an instance of the XmlSerializer with the type
// of object that is being deserialized.
var mySerializer = new XmlSerializer(typeof(MySerializableClass));
// To read the file, create a FileStream.
using var myFileStream = new FileStream("myFileName.xml", FileMode.Open);
// Call the Deserialize method and cast to the object type.
var myObject = (MySerializableClass)mySerializer.Deserialize(myFileStream);

the semicolon at the end of the using statement causes the following myFileStream to be undefined

Page URL

https://learn.microsoft.com/en-us/dotnet/standard/serialization/how-to-deserialize-an-object

Content source URL

https://github.com/dotnet/docs/blob/main/docs/standard/serialization/how-to-deserialize-an-object.md

Document Version Independent Id

b204adb3-855a-db49-a25c-71df4daf5988

Article author

@gewarren

Metadata

  • ID: 4c51e06b-f665-e97c-0862-02a7c33402ad
  • Service: dotnet-fundamentals
@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

1 participant