in my WPF application code i got the following Warnings:
CA2202 Do not dispose objects multiple times Object 'fs' can be disposed more than once in method 'MainWindow.TestResults_Click(object, RoutedEventArgs)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object. : Lines: 429 yesMonitor MainWindow.xaml.cs 429
for code:
FileStream fs = new FileStream(System.AppDomain.CurrentDomain.BaseDirectory + "TestResult.htm", FileMode.Create);
using (fs)
{
using (StreamWriter w = new StreamWriter(fs, Encoding.UTF8))
{
w.WriteLine(GetTestResultsHtml());
}
}
what should be the reason for these warning?