SPFeatureDefinition.DefaultResourceFile Property
Gets a partial name of a file that contains localized resources used by this Feature.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public ReadOnly Property DefaultResourceFile As String
Get
'Usage
Dim instance As SPFeatureDefinition
Dim value As String
value = instance.DefaultResourceFile
public string DefaultResourceFile { get; }
Property Value
Type: System.String
Returns a String that identifies a resource file.
Remarks
The DefaultResourceFile property corresponds to the DefaultResourceFile attribute of the Feature element in the XML that defines a Feature. When you define a Feature, you can set the DefaultResourceFile attribute to specify a shared file with localized resources used by all the Features in your application.
If the DefaultResourceFile attribute is set, then SharePoint Foundation looks for a culture-specific resource file on the path %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\Resources. SharePoint Foundation expects the file to be named on the pattern <DefaultResourceFile>.<CultureName>.resx, where DefaultResourceFile is the value of the DefaultResourceFile attribute and CultureName is in the format used by the CultureInfo.Name property. The string returned by the DefaultResourceFile property is the first part of the file name.
If the DefaultResourceFile attribute is omitted from the Feature definition, the DefaultResourceFile property returns an empty string. In this case, SharePoint Foundation retrieves resources for the Feature from a resource file in a subfolder named Resources below the Feature's folder on the file system--that is, on the path %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATES\FEATURES\<FeatureName>\Resources. SharePoint Foundation expects the resource file to be named on the pattern Resources.<CultureName>.resx.
See Also
Reference
Microsoft.SharePoint.Administration Namespace