Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio : can't find "resource file" in list of items to add to project

I'm on VS Community 2017 RC. I'd like to add a resource file (.resx) to my project but this item type is not listed in the itemscan't find resource file type

Have I missed something ? Do I need to install anything on top of my Visual Studio to be able to manage resource files ?

like image 245
bob Avatar asked Feb 26 '17 19:02

bob


People also ask

Where is the resource file in Visual Studio?

At the top right corner you have a searchbox, try typing it there and see if it finds anything. It should now open the new file with the resources designer. Now open the properties pane for that file (right click it in the solution explorer) and make sure it has the following set: Build Action: Embedded resource.

How do I add a resource to Visual Studio Project?

In Visual Studio, open a SharePoint solution. In Solution Explorer, choose a SharePoint project node, and then, on the menu bar, choose Project > Add New Item. In the Add New Item dialog box, choose the Global Resources File template, and then choose the Add button.

How do I add embedded resources to Visual Studio?

Open Solution Explorer add files you want to embed. Right click on the files then click on Properties . In Properties window and change Build Action to Embedded Resource . After that you should write the embedded resources to file in order to be able to run it.

How do I add a feature resource in Visual Studio?

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. When the Resource Editor opens in Visual Studio, add resources to the resource file.

Can I work with a resource file in Visual Studio?

You can work with resource files and resources from within your project. You can also work with ones that aren't part of the current project or were created outside the development environment of Visual Studio. For example, you can:

How do I add a resource file to a SharePoint project?

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. In Visual Studio, open a SharePoint solution. In Solution Explorer, choose a SharePoint project node, and then, on the menu bar, choose Project > Add New Item.

How to add files to Visual Studio projects?

Adding Files to Visual Studio Projects. 1 Ctrl-N to open new Item Dialog. 2 Ctrl-E to Search box. 3 Type search text like WPF Window. 4 Tab to list and scroll to item (if necessary) 5 Tab to filename and change. 6 Press Enter to add file.


2 Answers

At the top right corner you have a searchbox, try typing it there and see if it finds anything.

If it doesn't, create a text file from the new item dialog and change the extension to

resx 

It should now open the new file with the resources designer. Now open the properties pane for that file (right click it in the solution explorer) and make sure it has the following set:

  • Build Action: Embedded resource
  • Custom tool: ResXFileCodeGenerator (or PublicResXFileCodeGenerator to generate a designer class with public visibility)

NOTE: According to the link Chris posted, my suggestion may not help if you have the express edition of visual studio.

like image 179
Slime recipe Avatar answered Sep 20 '22 07:09

Slime recipe


Visual Studio Express editions do not support Resource View's. It is commonly recommended that you make your way to the Visual Studio Community editions to take full advantage of such features.

Here is the MSDN link that notes the feature not being supported.

Additionally, maybe you can try this:

Right click your project and go to properties >

enter image description here

Click 'Resources' > and then you may see:

"This project does not contain a default resources file. Click here to create one." enter image description here

like image 45
Chris Cruz Avatar answered Sep 19 '22 07:09

Chris Cruz