NDepend.API Documentation
TryLoadRuleFile(IAbsoluteFilePath,Boolean,IGroup,String) Method
NDepend.Project Namespace > ExtensionMethodsProject Class > TryLoadRuleFile Method : TryLoadRuleFile(IAbsoluteFilePath,Boolean,IGroup,String) Method
The absolute path to the rule file.
A value that indicates whether the loaded rule file is active or not.
The group of code queries and rules, not null only if this method returns true.
If the method returns false, failureReason is not null not empty, and explains in plain-english why the rule files' code queries and rules haven't been loaded.
Try load code rules and queries defined in the rule file defined by ruleFilePath.
Syntax
[Extension()]
public static bool TryLoadRuleFile( 
   IAbsoluteFilePath ruleFilePath,
   bool isActive,
   out IGroup group,
   out string failureReason
)

Parameters

ruleFilePath
The absolute path to the rule file.
isActive
A value that indicates whether the loaded rule file is active or not.
group
The group of code queries and rules, not null only if this method returns true.
failureReason
If the method returns false, failureReason is not null not empty, and explains in plain-english why the rule files' code queries and rules haven't been loaded.

Return Value

true if the rules have been properly loaded from the rule file, else returns false.
Remarks
isActive is defined in the project file and can be obtained from IRuleFileRef.IRuleFileRef.IsActive.
Requirements

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

See Also

Reference

ExtensionMethodsProject Class
ExtensionMethodsProject Members
Overload List