NDepend.API Documentation
TryGetSourceFileContent Method
NDepend.CodeModel Namespace > ExtensionMethodsHelpers Class : TryGetSourceFileContent Method
The code base that contains the source file.
The source file absolute path obtained from ICodeElement.ICodeElement.SourceDecls or from ICodeBase.ICodeBase.SourceFiles.
If this method succeeds and returns true, contains source file content.
If this method fails and returns false, contains a plain-english description of the failure.
Try to get the content of a source file as it was at analysis time.
Syntax

Parameters

codeBase
The code base that contains the source file.
sourceFilePath
The source file absolute path obtained from ICodeElement.ICodeElement.SourceDecls or from ICodeBase.ICodeBase.SourceFiles.
sourceFileContent
If this method succeeds and returns true, contains source file content.
failureReason
If this method fails and returns false, contains a plain-english description of the failure.
Remarks
If is true (which is the default value) source files get zipped at analysis time.
This method attempts to retrieve a source file content from this zipped store.
This method is different than trying to get the content from sourceFilePath. Since the analysis has been executed the source file might have been edited or removed.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsHelpers Class
ExtensionMethodsHelpers Members
ZipSourceFiles Property