Inserts the contents of a file on disk into the text buffer.
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
The specified path is invalid (for example, it is on an unmapped drive).
filePath is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars.
The file specified in filePath was not found.
The caller does not have the required permission.
The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
filePath specifies a file that is read-only, or this operation is not supported on the current platform, or filePath specifies a directory, or the caller does not have the required permission.
An I/O error occurred while opening the file.
filePath is null.
filePath is in an invalid format.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.