locked
The resource name 'Form.Msg.Str.XXX' is not a valid identifier? RRS feed

  • Question

  • Dear All,

    Does "." supported by resource file?

    Code can access the rescource string even the exclamation mark message shows The resource name 'Form.Msg.Str.XXX" is not a valid identifier?

    Thanks and Best regards,

    E-John



    • Edited by E-John Thursday, October 24, 2019 6:58 AM
    Thursday, October 24, 2019 6:52 AM

All replies

  • Hi E-John,

    I'm afraid we can NOT use "." in Resource Name.
    I'm using "_", instead of ".".

    Regards,

    Ashidacchi -- http://hokusosha.com

    Friday, October 25, 2019 2:58 AM
  • Hi Ashidacchi,

    Thanks for your reply.

    In my project, there are two kinds of files hierarchy exist.

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

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

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

    Best regards,

    E-John

    Friday, October 25, 2019 6:33 AM
  • Hi E-John,

    This is a picture of my project (Windows Forms, C#, one Project in one solution).

        

    Do you have more than one project in your solution? 
    Please provide more wide-range picture, and provide your project-type.
    Regards,

    Ashidacchi -- http://hokusosha.com

    Friday, October 25, 2019 7:17 AM
  • @E-John,

    I found you created a new thread about the similar issue.
    Has this issue been resolved? 
    Regards,

    Ashidacchi -- http://hokusosha.com

    Friday, October 25, 2019 8:17 AM
  • Hi E-John,

    >>If XXX.resx files are under the XXX.Designer.cs, the "." is acceptable and NO warning icon shows.

    ##Did you mean that you create a class like xxx.Designer.cs and add a resource file under it? If so, how did you do that?

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

    In general, the xxx.Designer will be created under Resource.resx file,which will automatically generate the code of the variable in the resource file and then call it in our code. So normally we don't edit this file. And this mode is designed by default.

    ##Besides##

    The variables we defined when we developed the code are all named after camel case, underlined. Defining variables like X.X.X is not allowed by VS. I tried to reproduce your problem by defining the variable in my resource file as X.X.X and assigning it a value, but without any errors. Then I call this parameter in the code and it turns out to be in x_x_x format. This seems to be corrected by vs.

    >> Or you can try to define the parameter in the editor like 'string a.b.c=2' which l think it will turn error.

    The same is true in the resource file.


    Hope it will help you.

    Best Regards,

    Perry


    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 MSDNFSF@microsoft.com

    Friday, October 25, 2019 8:28 AM