Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to regenerate a missing .resx file?

Tags:

.net

resx

I have the source for a project, but am missing the .resx file, which prevents compilation. Is there a way to re-generate a resx file for it? This is a C# project I created with Visual Studio 2010 Professional on an XP machine that I'm trying to open with Visual Studio 2012 Ultimate on a Windows 8 machine.

UPDATE

It (Resources.resx) was actually there (under Properties), so I guess "cannot be found" means: "I don't like the one you gave me."

When I mashed F6 to give it another try, I got the warning, "A custom tool 'ResXFileCodeGenerator' is associated with file 'Properties\Resources.resx', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool."

also: "A custom tool 'SettingsSingleFileGenerator' is associated with file 'Properties\Settings.settings', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool."

I ran "Run Custom Tool" for both Resources.resx and Settings.settings, and still get the same error and two warnings.

like image 871
B. Clay Shannon-B. Crow Raven Avatar asked Nov 13 '12 00:11

B. Clay Shannon-B. Crow Raven


People also ask

How do I view a RESX file?

Open a . resx file in the XML (Text) editor. Press Ctrl+Alt+F or choose ReSharper | Windows | File Structure from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.

How do I get .resx file strings in asp net core?

Create a folder in whatever project you want to store the resx files in - default, call it "Resources". Create a new resx file with the specific culture and the file name you'll look up later: If you had a shared one, you could do: SharedResource. en-US. resx.


2 Answers

If you have compiled the project in the past and have the dll/exe available, you can use JetBrains' DotPeek app to export the resx XML from the assembly

Open the dll/exe in DotPeek

enter image description here

Then double-click each resource to see the XML in a window. You can then copy/paste the XML into a text editor and save as a .resx file.

Don't bother right-clicking the resource and trying the 'Save Resource to File' option, as this doesn't create the file in the same format as you see on the screen.

like image 156
DeanOC Avatar answered Sep 21 '22 02:09

DeanOC


Right click and remove .resx form project right click on form and update resource manager build project run project

like image 20
Milind Morey Avatar answered Sep 20 '22 02:09

Milind Morey