Condividi tramite


How to: Add a resource file

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The commands for adding resource files is on the shortcut menu of the solution node and feature nodes in Solution Explorer. For more information, see Localizing SharePoint solutions.

To add a global resource file to a SharePoint solution

  1. In Visual Studio, open a SharePoint solution.

  2. In Solution Explorer, choose a SharePoint project node, and then, on the menu bar, choose Project > Add New Item.

  3. In the Add New Item dialog box, choose the Global Resources File template, and then choose the Add button.

    Note

    The Global Resources File project item template appears only when a SharePoint project item is selected.

  4. In the Add Resource dialog box, choose a culture for the resource file, such as English (United States).

    This step adds a global resource file to your solution in the format, Resource_x_.culture.resx, such as, Resource1.en-US.resx.

  5. When the Resource Editor opens in Visual Studio, add resources to the resource file.

To add a feature resource file to a SharePoint feature

  1. If the SharePoint solution is not already open in Visual Studio, open the solution.

  2. In Solution Explorer, open the shortcut menu for the name of a feature under the Features node, and then choose Add Feature Resource.

    This step adds a resource file to the feature in the format, ResourceFileName.culture.resx, such as, Feature1.en-US.resx.

  3. When the Resource Editor opens in Visual Studio, add resources to the resource file.

See also