How to fix the 'Resources' is not a member of 'My'

后端 未结 23 1479
醉话见心
醉话见心 2021-01-17 09:54

I am using VS2010 and in all of my projects \"My.Resources\" is available and shows all the files that are in the \"resources\" section of the project. In this one project I

23条回答
  •  孤独总比滥情好
    2021-01-17 10:26

    I'm unsure if Web Applications work differently or not with regards to the My.Resources namespace but none of the other solutions in this question helped at all.

    My resources were auto completing normally but I got the

    Resources is not a member of My

    errors in the error window.

    I finally resolved the issue by importing the My namespace at the top of the class file.

    i.e

    Imports .My
    

    and could then access the resources by calling only:

    String x = Resources.
    

    Strangely it would not work importing ONLY the App namespace. I had to also import My too

提交回复
热议问题