The type or namespace name 'Resources' does not exist in the namespace 'xxxxx.xxxx.Properties' (are you missing an assembly reference?) RRS feed

  • 質問

  • I am using VS 2008 on an existing project that was converted from VS2005 long time ago.  The project uses some *.Gif, *.bmp, etc.. files that was imported long before the conversion.

    today, I just added a picture box to an existing control by droping the picture box on the control.  And then I assigned a graphic file to the immage property.  Every thing looks cool, and the picture is shown on the control.

    After then, I got ton of build errors (same error) on all source file that using any pictures.  The error is below:

    "The type or namespace name 'Resources' does not exist in the namespace 'xxx.xx.Properties' (are you missing an assembly reference?) "

    Clicking on one of the error leads me to a line of code like this (code like this are auto generated by VS and store in the xxx.designer.cs files):

    this.picSample1.Image = global::xxx.xx.Properties.Resources.Sample_Revenue;

    What could have go wrong here?  How do I make my project compile again?


    David N.
    2008年8月13日 5:19



  •  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"
    Elroy D.
    2008年8月13日 8:37
  • Sounds like 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.
    Hans Passant.
    2008年8月13日 10:32
  • Move the option the checkbox  "Access Modifier" at "public" in the file .resx
    • 回答の候補に設定 Tidosho 2010年11月23日 8:38
    2010年3月5日 18:53
  • Changing the Access Modifier worked for me in VS2010. I'm working on a soundboard, and for some reason my laptop ran out of memory (I have 2 GB) while building and saving, so my resources designer wasn't present. It was seemingly corrupt, and changing the Access Modifier regenerated it!

    Does anyone know if there's a maximum resources file limit? I ask as my soundboard uses a lot of WAV soundbites!

    2010年11月23日 8:41
  • Right Click the resource file on Properties folder and click "Run Custom Tool".

    And... your project is Fixed.

    • 回答の候補に設定 marreco 2013年4月16日 21:16
    2013年4月16日 21:12
  • In my case the folder 'Resources' simply gone after I restart my laptop. Then I copied it from an older backup and did the procedure above.
    The project is running fine now.
    2014年1月30日 13:33
  • Thank you!!!
    2014年5月7日 16:17
  • LOL 6 years later, very useful.  I've been able to see a dialog with the problem which is a Resource in the folder I deleted and the dialog told me that it wasn't able to find the resources.  I double clicked the Resources.resx and deleted the missing resource.  Problem solved.  Thank you.
    • 編集済み GearWorld 2019年7月9日 15:58 Added some text
    2019年7月9日 15:57