Resource.designer.cs is NOT regenerated in Mono (Xamarin Studio)

I am currently developing an application with Mono, recently upgraded to Xamarin Studio 4.0.8, and I am having problems with which design elements are not added to the solution.

I tried to manually edit the .cs constructor, and later I deleted it, hoping that the program will regenerate it again, with a change in layout.

I tried:

  • Restore it

  • Cleaning and recovery

  • Delete a file through file explorer

And it still does not recover properly, Xamarin creates Resource.designer.cs, but it is empty, and when compiling it returns this:

Error CS0103: The name 'Resource' doesn't exist in the current context (CS0103) 

Help me please...

+8
android c # mono xamarin monodevelop
source share
3 answers

It happened to me a while ago. If you right-click on your XML file and click on properties. Make sure Build Action is set to AndroidResource

If I remember correctly that he recorded it

+4
source share

A lot of time related to this problem. What I've done:

  • Delete "resources.designer.cs" with Xamarin (extra button-> delete).
  • Go to the command prompt (finder on Mac / Explorer on Windows) and manually delete the file (make sure you delete it).
  • Go to Xamarin, clean-> build (this will restore resoruces.designer.cs).
  • When you delete a file from a project, you must add it again. secondary button above the project-> add files-> select "Resources .designer.cs" (the folder "Forward" / "Resources").
  • Make sure that the "Build Action" of the Resource.designer.cs file is a compilation (sometimes it requires a different build action by default).
  • Clean and build.

At least he worked most of the time.

+4
source share

This work for me:

  • Open the .designer.cs file and delete the entire contents of the class, allowing only the class declaration.
  • open a .xib file or storyboard that cause problems with your .cs file.
  • update Identify> A view class property that uses this .designer.cs class removes, does not focus, focuses, and sets the value of the property again.
  • save
  • rebuild
0
source share

All Articles