Share via


SPHealthAnalysisRule.Version property

Gets the version for the current instance of the rule.

Namespace:  Microsoft.SharePoint.Administration.Health
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property Version As Version
    Get
'Usage
Dim instance As SPHealthAnalysisRule
Dim value As Version

value = instance.Version
public virtual Version Version { get; }

Property value

Type: System.Version
The version number of the current instance of the rule.

Remarks

When you upgrade a rule that you have previously deployed to the farm, the Version property of the upgrade is checked against the Version property of the existing rule definition. If the version number of the upgrade is greater, then existing settings for the rule are overwritten by settings defined in the upgrade. This can be useful if you want to reset the AutomaticExecutionParameters property to specify a new default schedule.

For example, imagine that you have developed and deployed a rule that runs hourly by default. Later, you discover that the execution of the rule degrades performance on some systems. You could revise the rule so that the default is to run monthly, then increment the value of the Version property and redeploy the rule.

Note that in this example if the farm administrator has edited the settings for the rule so that it is scheduled to run weekly, upgrading to the new version of the rule will overwrite the administrator’s preference. For this reason, you would not want to increment the Version property for every upgrade, only for upgrades that involve changes that must have priority over local preferences.

See also

Reference

SPHealthAnalysisRule class

SPHealthAnalysisRule members

Microsoft.SharePoint.Administration.Health namespace

RegisterRules(Assembly)

AddItem(SPHealthAnalysisRule, Boolean)