-
Hi,
And testing with
I noticed that resgen.exe is used to generate them but I wasn’t able to call it. So my question is, would someone know how I can generate Designer files from resx in GitHub Actions? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
I’m afraid you can’t generate a .Designer.cs from a .resx in your WinForm application.
According to the above introductions, logically, there is no relationship between the resource file and the designer file. The designer file (.Designer.cs) is required for the WinForm application, you can’t ignore it in your project.
The Resource File Generator (Resgen.exe) is used to convert the resource files to common language runtime binary (.resources) files that can be embedded in a runtime binary executable or satellite assembly. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer,
As you said, it’s generated by VS and I would have like to force the generation by GitHub CI |
Beta Was this translation helpful? Give feedback.
-
If you can use the .resx file to generate the .Designer.cs file on your local environment, maybe you can try to list the completed steps you have used, and check the command lines you were using to execute these steps. Then you can try to run these command lines in your workflow to see if it can work. |
Beta Was this translation helpful? Give feedback.
-
The issue is that I’m not using any command, they are automatically generated. |
Beta Was this translation helpful? Give feedback.
-
Of course, as mentioned above, it is generally the .Designer.cs file is automatically generated by VS, it is not generated from the .resx file. You may have some misunderstandings about the .resx file. |
Beta Was this translation helpful? Give feedback.
-
Yeah I’m indeed a bit confused by that, since the .Designer.cs contains what is inside the .resx and a way to access it in C#, why isn’t it “generated from it”? |
Beta Was this translation helpful? Give feedback.
-
Sometimes, the .Designer.cs may reference some strings defined in the resource file to set the contents displayed on the application UI. But this does not mean the .Designer.cs is generated from the resource file. In the .csproj file, normally it will list all the required source files of the application.
Essentially, there is no relationship between the .Designer.cs and the .resx. |
Beta Was this translation helpful? Give feedback.
-
Inside my *Designer.cs file:
I think the comments downplaying the connection between the 2 files can’t be applicable in all cases. In my case this file is absolutely fully generated from the .ResX file. I was able to fully generate the file .Designer.cs file using the information here: docs.microsoft.comResgen.exe (Resource File Generator)Use Resgen.exe, the Resource File Generator. Convert text (.txt, .restext) and XML resource format (.resx) files to embeddable CLR runtime binaries (.resources). using the /str option. |
Beta Was this translation helpful? Give feedback.
-
Can you elaborate a bit more on the command line to resgen.exe that can regenerate .designer.cs files? For example, sample command lines? I’ve poked at every command line option in the help, and can’t find the magic incantation that does anything other than generate resources.resources. I’m sure I’ll smack my forehead and say, “doh” when I see it…but I’m having a heck of a time doing it now (Visual Studio steadfastly refuses to regenerate the .designer.cs file, no matter what I poke in the project/solution). Thanks. |
Beta Was this translation helpful? Give feedback.
-
I had this problem, I found a solution by reading the references: dotnet/sdk#94 (comment) |
Beta Was this translation helpful? Give feedback.
@Xwilarg,
Sometimes, the .Designer.cs may reference some strings defined in the resource file to set the contents displayed on the application UI. But this does not mean the .Designer.cs is generated from the resource file.
Other files in the project may also reference the data defined in the resource file, that also does not mean these files are generated from the resource file.
In the .csproj file, normally it will list all the required source files of the application.
The .Designer.cs defines the UI of the application, it is required. Maybe, sometimes the .Designer.cs defines an empty or blank UI when the application does not need a UI.
The .resx file defines some data may be refer…