IVsMSBuildTaskFileManager.GetFileContents Method

Gets the contents of a specified file.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.9.0 (in Microsoft.VisualStudio.Shell.Interop.9.0.dll)


Function GetFileContents ( _
    wszFilename As String, _
    <OutAttribute> ByRef pbstrFileContents As String _
) As Integer
‘사용 방법
Dim instance As IVsMSBuildTaskFileManager
Dim wszFilename As String
Dim pbstrFileContents As String
Dim returnValue As Integer

returnValue = instance.GetFileContents(wszFilename, _
int GetFileContents(
    string wszFilename,
    out string pbstrFileContents
int GetFileContents(
    [InAttribute] String^ wszFilename, 
    [OutAttribute] String^% pbstrFileContents
abstract GetFileContents : 
        wszFilename:string * 
        pbstrFileContents:string byref -> int 
function GetFileContents(
    wszFilename : String, 
    pbstrFileContents : String
) : int


  • pbstrFileContents
    Type: System.String%
    [out] The contents of the file.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.


This method returns the contents of the specified file based on what is in memory or what is on disk if not in-memory.

COM Signature

From vsshell90.idl:

HRESULT GetFileContents(
    [in] LPCOLESTR wszFilename,
    [out, retval] BSTR* pbstrFileContents

.NET Framework Security

See Also


IVsMSBuildTaskFileManager Interface

IVsMSBuildTaskFileManager Members

Microsoft.VisualStudio.Shell.Interop Namespace