C# C# Streams and Data Processing Serialization Deserializing with Json.NET

C# Serializing Coding Challenge - Issue with wrapping the StreamReader object in a 'using' statement.

using( var reader = new StreamReader(fileName) )

I'm not sure why the code for task 2 doesn't work. I've tried it with and without curly braces/brackets. I've tried instantiating the StreamReader object and THEN passing it to the using statment, even though that is not the recommended way. No matter what I do the response I get is, "Did you wrap your StreamReader object in a using statement?" The syntax here should be just like what we have done already. Maybe there is something obviously wrong with my code, but I'm just not realizing it.

1 Answer

Steven Parker
Steven Parker
186,664 Points

This would be no problem in actual code, but the challenge apparently doesn't like the space padding inside the parentheses of the using statement.

You may want to report this as a bug to Support.