Bug 10651 - [VS] Designer should update Resource.Designer.cs file before building
Summary: [VS] Designer should update Resource.Designer.cs file before building
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.0
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: PJ
Depends on:
Reported: 2013-02-25 14:05 UTC by PJ
Modified: 2015-10-19 10:40 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description PJ 2013-02-25 14:05:51 UTC
Steps to reproduce:

1) Create a new Android application
2) Open the .axml file
3) Add a button that is called button1
4) Add Button button1 = FindViewById<Button> (Resource.Id.button1); to your main Activity.
5) Build

Expected behavior:

Build should succeed as the button1 does exist

Actual behavior:

Build does not succeed because the Resource.Designer.cs file is not updated before the build is attempted.
Comment 1 sothy.chan 2014-06-09 21:01:07 UTC
I am having the same issue.  I noticed that rebuilding the project before referencing the resource in your activity will cause Resource.Designer.cs to update. As a result, you can now reference the button.  This workaround was working for a while until recently.  The Resource.Designer.cs file will not update no matter what I do.


Steps to recreate:
1) Create Android application
2) Create a new axml file
3) Rebuild project
4) Use view reference in activity
5) Build

Expected behavior

Resource.Designer.cs will have a reference to the new views that were created in the axml file.  This will allow us to reference it in the activities.

Actual Behavior:

Resource.Designer.cs file will not update so you cannot reference the view in the activity.