Reputation: 10297
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.
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.
Upvotes: 18
Views: 48768
Reputation: 1
Like user Battle, I come from the future, Visual Studio 2019. I tried the answers here and did not achieve success.
In the end, I opened the .vbproj file in Notepad++ and removed any references to Resources.resx. Since it's a well structured text file, it was not difficult.
I could do this because my application is a console application and is relatively simple. Make a backup first!
Upvotes: 0
Reputation: 2989
After deleting the problematic .resx file in my WinForms project I just doubleclicked the form to open it (hurrah - it opened again!) and the .resx file got recreated. VS Community 2022 (64 bit) Version 17.7.4.
Upvotes: 1
Reputation: 816
I come from the future, Visual Studio 2019. I had the same issue after a bigger merging process (for some reason it asked me to merge a lot or all of *.Design files). It was apparent that somehow I had to regenerate the auto-generated Code from the .resx files.
Solution: I changed an entry (the name, not the value), saved it, changed it back, saved it. This seems to have forced a regeneration of all .resx files, and the project was compiling again.
Just do a single change that would necessitate a change in the auto-generated code.
Upvotes: 4
Reputation: 7282
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
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.
Upvotes: 7
Reputation: 21
Visual Studio 2012-2015 users For a Web Application, simply select the Web Control (ascx) or Page (aspx) that is missing the resx in Solution Explorer and go to the Project menu and select "Convert to Web Application", press OK on the prompt. You should see the new files under the selected item in Solution Explorer.
Upvotes: 1
Reputation: 57
copy the .resx
file of any other form in the project to the project folder and try again. It worked for me.
Upvotes: 0
Reputation: 497
I had this problem on a form I created for a rather extensive project. I was able to simply copy the resx of another form, in the same project, and change the filename.
I went through over a dozen of the resx files in my project and noticed that most of them were identical; the few that were not, only differed by one or two extra lines.
Upvotes: 2
Reputation: 2116
Right click and remove .resx form project right click on form and update resource manager build project run project
Upvotes: 6
Reputation: 2457
I know this question is a little old, but I was having problems generate the .resources.dll files and after recently changing the .NET Framework version, the .ResX files still included the old .NET Framework version. I was able to resolve this by opening the affected forms and going to "Design" -> "Localizable" and changing it to "False". Then I built the project and then changed it back to "True" and the .ResX file was regenerated.
Upvotes: 4
Reputation: 10297
Here's how I solved it: I opened the missing ancillary files (AssemblyInfo.cs, Resources.resx, Resources.Designer.cs, Settings.settings, and Settings.Designer.cs) from another project in Notepad, removed the things that didn't belong (such as the reference to ThemeEditor or some such), changed other things as necessary (the name of the app or package), and these were finally accepted as those belonging to my app.
Upvotes: 1
Reputation: 13599
As far as I have read there is no way to regenerate .resx file but you can go another way you can create another/same win application and all the controls aspects to it . Than take a newly created resx file and add to old project. Try it maybe it will work
Upvotes: 1