Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

c# - 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 ?

question from:https://stackoverflow.com/questions/42473315/visual-studio-cant-find-resource-file-in-list-of-items-to-add-to-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...