I have the following 2 lines in ASP.NET in VB.NET (For C# just replace the world ‘Dim’ with ‘var’) that I got from an example.
Dim tmpFile = Path.GetTempFileName()
Dim tmpFileStream = File.OpenWrite(tmpFile)
I get an error on File.OpenWrite(tmpFile) that says ‘Overload resolution failed because no accessible ‘File’ accepts this number of arguments’. Can anyone explain why this error is happening? I tried looking at documentation and can’t seem to figure it out. Thank you.
Notice that the error message is specifying
Fileand notOpenWrite. It looks like there is anotherFilein context which has a higher precedence thanSystem.IO.File. This is likely the source of the error. Try using a fully qualified name here