Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need the resx Designer.cs file?

My company uses a combination of some database tables, a web page front end and an "export" application to handle our string resources in our web sites.

The export application used to work just fine when we used VS2008, but since switching to VS2010 the resources now have a designer.cs file "beneath" them in the solution explorer.

The problem is that the "export" application only generates the .resx files and not the underlying designer.cs files.

So, is there a way to not have those designer.cs files, or alternatively some way to automatically re-generate (or even some command the export application could call to re-generate them)

like image 269
Antony Scott Avatar asked Jul 09 '10 23:07

Antony Scott


People also ask

What is designer CS file?

The designer file (. Designer. cs) is a code file automatically generated by your designer to hold the form's layout information that was created using the Visual Studio IDE. Once you add a new form in your application, VS will automatically generate the designer file for this form.

How do I generate designer CS from Resx?

Right click the resx-file and select properties. Add the value "PublicResXFileCodeGenerator" to the "Custom Tool" property then the designer file will be generated.

What is the RESX file?

resx resource file format consists of XML entries that specify objects and strings inside XML tags. One advantage of a . resx file is that when opened with a text editor (such as Notepad) it can be written to, parsed, and manipulated.

What is a .resx file and how do you use it?

Resource file used by programs developed with Microsoft's . NET Framework; stores objects and strings for a program in an XML format; may contain both plain text information as well as binary data, which is encoded as text within the XML tags.


1 Answers

I had a problem where VS 2010 would not regenerate the Designer.cs files, and couldn't find the solution elsewhere.

I was able to regenerate them though, without going to the command line.

To fix the issue in Visual Studio 2010 I did the following:

  1. Deleted the Designer.cs file
  2. Right clicked on the main resx file
  3. Selected Run Custom Tool

That rebuilt the Designer.cs file.

Hope that might help someone else in the future..

like image 95
ianneub Avatar answered Oct 14 '22 00:10

ianneub