Share via


How to make the XXX.resx files under XXX.Designer.cs in Visual Studio 2017?

Question

Friday, October 25, 2019 6:48 AM

Dear All,

How to make the XXX.resx files under XXX.Designer.cs in Visual Studio 2017?

In my project, there are two kinds of file hierarchy exist. (Fig.1)

If XXX.Designer.cs is under one XXX.resx file, the exclamation mark message shows as this question asked. (Fig.2)

If XXX.resx files are under the XXX.Designer.cs, the "." is acceptable and NO warning icon shows. (Fig.3)

I just don't know to make the XXX.resx files under XXX.Designer.cs, it was added a long time ago.

Fig.1

Fig.2

Fig.3

Best regards,

E-John

All replies (2)

Monday, October 28, 2019 2:41 AM

Hi E-John,

Sorry for delay in reply.

As far as I know, the XXX.designer.cs is automatically generated by ResXFileCodeGenerator tool in VS IDE.                                                                                                       

When you want to separate them, the resx would just be a resource file and the designer.cs would just be a normal class file. If the resx file has been changed, the designer.cs would not be updated automatically any more.

So,

  • If you don't need designer.cs file, you could delete "ResXFileCodeGenerator"
  • If you want to save the designer, you could exclude them in solution explorer,                                                             then move them to other folder, finally re-add them into project.

Hope it could help you, and if you have other questions about it, please feel free to contact us.

Look forward to your feedback.

Best Regards,

Dylan

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]


Monday, October 28, 2019 6:21 AM

Try closing the solution, then opening the project file (.csproj) in some simple text editor (Notepad). Check how <DependentUpon> element is used for pairs of files. You can try editing the project file manually to adjust the tree.

But firstly, backup your files and perform the experiments on some new separate project.

Since the names are supposed to be used programmatically, try avoiding ‘.’ and other symbols that are not allowed. Use ‘_’, for example.