Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileNotFoundException Class

The exception that is thrown when an attempt to access a file that does not exist on disk fails.

For a list of all members of this type, see FileNotFoundException Members.


[Visual Basic]
Public Class FileNotFoundException
   Inherits IOException
public class FileNotFoundException : IOException
public __gc class FileNotFoundException : public IOException
class FileNotFoundException extends IOException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


FileNotFoundException uses the HRESULT COR_E_FILENOTFOUND which has the value 0x80070002.


Namespace: System.IO

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

FileNotFoundException Members | System.IO Namespace | Exception | Handling and Throwing Exceptions | Working with I/O | Reading Text from a File | Writing Text to a File

© 2018 Microsoft