Generic methods for serializing and deserialzing xml files using streams followup
So my question, is this good code? is this a proper work around?


I would ask different questions:


Does the code work?
Could you avoid editing the csproj file?


If both answers are yes, the I'd say it's a good workaround... but not a perfect one.


stream.Close();



This line shouldn't be there. The caller should take care of disposing the stream. Every method should keep track only of its own resources. The ones that come from the outside world should be taken care of by their respective owner.

I'd be really surprised if I called this method and wanted to work with the stream later but get an exception that it has already been closed.