43

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 ?

4 Answers 4

57

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.

3
  • I've been able to create working .resx file his way. Don't forget to make the resource files Public instead of Internal (default).
    – bob
    Feb 26, 2017 at 21:56
  • This worked for me, but I checked the other Resource files in my solution, and they have Custom tool: PublicResXFileCodeGenerator. Just wanted to add my setting in case it helps others. I'm in Visual Studio 2017.
    – Ryan Hoyle
    Oct 3, 2017 at 14:58
  • FWIW when I added a file with the extension .resx VS automatically recognized it as a resource file and set the appropriate Build Action. I still had to change the Custom Tool setting, however. Dec 14, 2018 at 4:35
25

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

5
  • I have no doubts that it could somehow work; however, it just would be native. You may not be able to edit it normally and such as you would it if it was directly supported within the IDE. Also, since it would just be a blank file - you will have to do the formatting and such manually.
    – Chris Cruz
    Feb 26, 2017 at 20:01
  • I updated my question since I've just realized I have 2017 Community RC, not Express.
    – bob
    Feb 26, 2017 at 20:14
  • Please see my edit with photos. Maybe this can work for you. I'm doing my best to try and figure something out for you - but there really ins't much info out there.
    – Chris Cruz
    Feb 26, 2017 at 20:29
  • Actually I'd like to create a class library wit multiple .resx files so this method doesn't suit my needs. I've been able to crate .resx files with the method described in Esh's answer.
    – bob
    Feb 26, 2017 at 21:55
  • 1
    Okay gotcha, well luckily you got it working for you. Good luck with the rest of this project!
    – Chris Cruz
    Feb 26, 2017 at 21:56
20

Some Visual Studio 2017 and 2019 workloads apparently don't include this feature, notably the ASP.NET workload. The solution, as detailed here, is to run the Visual Studio Installer and add the desktop development workload.

1
  • 1
    Simplest solution - Resources were simply not installed, and adding desktop development only required 20MB. Thanks!
    – Kobi
    Feb 19, 2019 at 8:35
1

Using VS 2015 Enterprise Edition, had this problem when I downloaded from our Git repository at work. Nobody knew what happened to those ".resx" files. I edited in Notepad++ the other (not missing ones) .resx files and found they all had the very same content. So I created new .resx files from scratch with that same content, reopened the solution and Build and Rebuild Solution worked like a charm.

2
  • 1
    check your .gitignore, maybe those files are not downloaded for a reason
    – Iria
    Jan 22, 2020 at 10:14
  • Thank you @Iria, that's a good remark. I checked but those weren't included in that file, so on this particular case that wasn't the cause. But thank you for pointing that out.
    – Javier D.
    Jan 23, 2020 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.