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

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

    I face this problem all the time and this solution works for me all the time.

    1. Click on Show All Files in solution explorer.

    2. Navigate to file named "Resources.resx" under "My Project" folder.

    3. In properties for that file rename the file's [Custom Tool Namespace] to anything other than "My.Resources". (I name it to "My.Resource").

    4. Clean and Rebuild the solution.

    5. Navigate back to "Resources.resx" in properties. Rename the file's [Custom Tool Namespace] back to "My.Resources".

    6. Clean and build the solution again.

    Your problem should be fixed.

    0 讨论(0)
  • 2021-01-17 10:32
    Private lockedImage = My.Resources.Resource.myfile
    

    Hope it works...

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

    According to Denis solution: I am adding little more details with his answer.

    Step 1 Click on Show All Files button.

    Step 2 Click on expand button left to My Project.

    Step 3 Right click on Resources.resx.

    Step 4 Click on Properties.

    Step 5 - Change the name My.Resources to anything example My.ResourcesRepair then save changes and again name it back to My.Resources and save changes and then rebuild.

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

    Fütemire described my problem. I had just "cleaned up" some unused files in both the resources (doing an Open My Project within VS) and probably (I must admit), I deleted some files directly from the Resources folder outside of VS. Oops.

    I just opened Resources.resx file and found two items that red underscores, indicating it couldn't find these files. I removed those data blocks within the XML file and that fixed the problem for me. Thanks.

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

    simply edit the Resources.resx in notepad++. Trace the cause of the error (error displays in the Resources tab of your project properties), remove the line that causes the error. then on your solution explorer, right-click Resources.resx then Run Custom Tool.

    this would surely resolve the problem.

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

    In My case the simple fix was

    1. Edit the resources.resx file to not have duplicate entries as mentioned above.
    2. Remove Last Entries you Entered, could be causing the problem
    3. Go to the 'My Project' section for you application.
    4. Change the application type from Windows Forms Application to Class Library, then change it back.
    5. In my case that hooked up the My.Resources again.
    0 讨论(0)
提交回复
热议问题