Xamarin Android - How to rebuild Resource.designer.cs

Karthik Murugesan picture Karthik Murugesan · Aug 21, 2013 · Viewed 47.8k times · Source

In Xamarin Android - How to regenerate the Resource.designer.cs

I tried to mark all the XML file's Build Action as "AndroidResource" and still the Resource.designer.cs won't get updated with new values.

What event trigger generating this file?

Answer

Brendan Zagaeski picture Brendan Zagaeski · Nov 1, 2013

As recently as Xamarin Studio 5.6 (build 273) with Xamarin.Android 4.18.0, if you have manually deleted the Resource.designer.cs file from the project, rebuilding will regenerate Resource.designer.cs, but will not add it back into the project. So after attempting to rebuild once, the file will be present in the file system, but not in the project. To fix this, manually add the newly generated file into the Resources folder in the project.