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

后端 未结 23 1167
醉话见心
醉话见心 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:25

    The previous solutions here did not work for me.

    The 'Resources' is not a member of 'My' was caused by trying to add an icon to a button. I tried running the custom tool on the Resources.resx and kept getting an error.

    My solution was to go into My Project > Resources and remove the added icon. Once that was done I did a clean & rebuild. That did the trick for me.

    0 讨论(0)
  • 2021-01-17 10:25

    After facing the same issue having used a couple of tools to assist in Resource Translation, this is what fixed it for me:

    • Go to "My Project", select the "Resources" tab
    • On top you'll see "Access Modifier"
    • In my case it was set to "(Custom)". Change it to Friend or "Public" (depending on your needs) and the error should be cleared.

    I'm using ResX Resource Manager plug in to assist with the translation. This error seems to keep re appearing whenever I try to manage a resource in Resource Manager while having "My Project" window open. When this happens, ResX Resource Manager throws an error and the My.Resources error re appears. Repeating the procedure above restores things to working condition again.

    0 讨论(0)
  • 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 <MyAppNameSpace>.My
    

    and could then access the resources by calling only:

    String x = Resources.<NameOfMyResource>
    

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

    0 讨论(0)
  • 2021-01-17 10:29

    In vb.net , if Resouce File available than just check Resorces.resx is available And Resorces.Designer.vb not Available than once Exclude Resorces.resx and include Resorces.resx than automatically generate Resorces.Designer.vb you got to fix all error related..

    0 讨论(0)
  • 2021-01-17 10:31

    On my case I just went to the code of Resources.rex and I deleted the last value entry of the image that caused the problem .. save then reopen again .. It worked fine to me.

     <data name="imagename" type="System.Resources.ResXFileRef, System.Windows.Forms">
        <value>..\Resources\imagename.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
      </data>
    

    ... HOW to show the Resorces.rex code :

    1. Solution Explorer - Click Show_All_files
    2. On [ My Project/Resources.resx ] select Resources.resx and press F7
    3. The last Value entry will be all way down of the page
    4. Make sure no duplicate value on that page
    0 讨论(0)
  • 2021-01-17 10:31

    I found an unusual way to fix this error. After trying so many things.

    I deleted images from the resources folder and ended up with 'Resources' is not a member of 'My' 170 errors

    This fixed the error. I deleted all files in the resource folder. I restored them from the recycle bin and all the errors went.

    0 讨论(0)
提交回复
热议问题