I am doing a simple file IO in MVC6. I have added
System.IO NuGet package. However, it gives me compile time error. VS IDE doesn't show any red mark when I type the code. The
Close() method also appears in intellisense. Please help!
StreamWriter writer = System.IO.File.CreateText("some_valid_path"); writer.WriteLine("test"); writer.Close();
StreamWriter does not contain a definition for 'Close' and no extension method 'Close' accepting a first argument of type 'StreamWriter' could be found (are you missing a using directive or an assembly reference?)