I'm currently developing an app with Mono, I recently updated to Xamarin Studio 4.0.8, and was having problems with the design elements not being added to the solution.
I tried to edit manually the designer.cs, and later on I erased it, hoping the program will regenerate it again, with the layout changes.
I have tried:
Rebuilding it
Cleaning and rebuilding
Erasing the file through the file explorer
And it still doesn't regenerate properly, Xamarin creates the Resource.designer.cs but it's empty, and when compiling it returns this:
Error CS0103: The name 'Resource' doesn't exist in the current context (CS0103)
Help please...
Show activity on this post. 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.
A bug in Xamarin.Studio 5.1 previously corrupted .csproj files by partially or completely deleting the xml code in the .csproj file. This would cause important parts of the Android build system (such as updating the Android Resource.designer.cs) to fail.
You can rename your project by using find/replace, but the resources file will use whatever is set for 'default namespace' in the Main Settings and will continue to revert to this name even if you manually edit the Resource.designer.cs file in or out of Xamarin. Show activity on this post.
The resource designer file is only generated when there is a change in the resource I applied following steps to generate the required resource.designer.cs file * Added a dummy image in the resources * Cleaned the project * Rebuild the project New resource.designer.cs generated. Show activity on this post. Show activity on this post.
Lots of time having this issue. What i did:
At least it have worked most of the time.
I had this happen a while back. If you right click on your XML file, and click properties. Make sure that the Build Action is set to "AndroidResource"
If I recall correctly that fixed it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With