Xamarin Android - How to rebuild Resource.designer.cs

前端 未结 16 556
孤独总比滥情好
孤独总比滥情好 2021-02-03 17:10

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.c

相关标签:
16条回答
  • 2021-02-03 18:02

    It would seem that this can happen for a number of reasons. One step that can help reveal the problem is to increase your build output verbosity in Visual studio: Tools -> Options -> Build and Run -> change the "MSBuild project build output verbosity" to "Diagnostic".

    In my case, one of my controls did not have an Id so it led to the Resource.Designer.cs not updating (but failing to do so silently).

    The file started updating again once I added an Id.

    NOTE: You will probably want to change the build output verbosity back to normal after you find your issue.

    0 讨论(0)
  • 2021-02-03 18:03

    For the rebuild project solution to work you have to edit the file that generates it and then rebuild the project.

    0 讨论(0)
  • 2021-02-03 18:03

    For people that are still having this issue, when you look at the error list some error might say something like "no resource found that matches the given 'toRightOf @id/(name of the resource)' (or any other position in relative layout)... you must highlight all the code of the resource (in the axml file) that has the id, cut, save all, then paste it and rebuilt... then your Resource.Designer.cs will regenerate! hope it helps.

    0 讨论(0)
  • 2021-02-03 18:06

    Make sure that your root package name is correct.

    0 讨论(0)
提交回复
热议问题