none
Resources are missing after debugging some code. RRS feed

  • Question

  • Sometime, I come across this error while debugging code.

    The type or namespace name 'Resources' does not exist in the namespace 'xxxxxxx' (are you missing an assembly reference?)

    And Resources are also present in project. What are reason behind this issue and how can it be resolved ?

    Thanks

    Tuesday, October 2, 2012 7:34 AM

Answers

  • Hi Itz.Irshad,

    You can try out following things:

    • Check if the .resx file that "Resources" was referring to is still available or not(properly referred to or not). Its name should be "Resources.resx
    • Another reason can be your project file got damaged.  Click on the Show All Files icon in Solution Explorer.  Open the Properties node, open Resources.resx, double-click Resources.Designer.cs.  Compare it to a backup copy of that same file

    Regards, http://www.shwetalodha.blogspot.in/

    Tuesday, October 2, 2012 2:09 PM
  • It is sometimes necessary to edit the designer file.  For example, if you delete a button click event the event handler is automatically added to the designer file.  If you delete the button click event in your code the event handle is still in the designer file and you must delete the event hadnler manually.

    I would comment out the lines of code that are giving you  the errors temparily until you better understand the root cause of the problem. The other alternative is to start a project from scratch if you don't fell comfortable in editing the designer file.


    jdweng

    Friday, October 5, 2012 4:13 PM

All replies

  • Usually you are missing some "using" statements at the top of your module, and/or you need to add a reference library to your project.  I usually highlight the method() that is giving the error and then use the menu in Visual Studio "Edit : Find and Replace : Find Symbol".  Then I add the "using" statement at the top of the module.  If I still have the error then I add the reference to the library using the menu "Project : Add Reference".  In some cases you may need to add the reference library "PresentationFramework", but this is rare.

    Note : Typo errors in your program can lead to the same error message if you mispell a function name that you created.  Visual Studio when it can't find function definition will give this error.  so first determine if you are using a Net Library function or one of your own functions.


    jdweng

    Tuesday, October 2, 2012 7:56 AM
  • Hi Itz.Irshad,

    You can try out following things:

    • Check if the .resx file that "Resources" was referring to is still available or not(properly referred to or not). Its name should be "Resources.resx
    • Another reason can be your project file got damaged.  Click on the Show All Files icon in Solution Explorer.  Open the Properties node, open Resources.resx, double-click Resources.Designer.cs.  Compare it to a backup copy of that same file

    Regards, http://www.shwetalodha.blogspot.in/

    Tuesday, October 2, 2012 2:09 PM
  • If this comes in my code, I'll surely handle this. But, it is in the Designer file of respective form. In Designer file, all the code is VS generated than why it comes during the debug mode. That's the point, which I'm looking for.
    Friday, October 5, 2012 1:26 PM
  • It is sometimes necessary to edit the designer file.  For example, if you delete a button click event the event handler is automatically added to the designer file.  If you delete the button click event in your code the event handle is still in the designer file and you must delete the event hadnler manually.

    I would comment out the lines of code that are giving you  the errors temparily until you better understand the root cause of the problem. The other alternative is to start a project from scratch if you don't fell comfortable in editing the designer file.


    jdweng

    Friday, October 5, 2012 4:13 PM