我在MVC6中做了一个简单的文件IO.我添加了System.IO NuGet包.但是,它给了我编译时错误.键入代码时,VS IDE不显示任何红色标记. Close()方法也出现在intellisense中.请帮忙!
我的代码
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?)
谢谢.