We are building a Xamarin forms app and every time any of the developers check in code it seems there are always changes being made to the Android Resources.designer.cs file. What is it that controls the automatic updates to that file? What do I need to stabilize in our dev environments across our developer machines to prevent that from aways getting different updates?
-
It is a common behavior as do not worry about such things. Even if you delete the file and rebuild the project, it will generate automatically. – Mahavir Kumbharvadia Sep 28 '20 at 20:12
3 Answers
You can safely add the file to .gitignore
, in Xamarin sample repo, they have the resource.designer file in gitignore too, https://github.com/xamarin/xamarin-forms-samples/blob/master/.gitignore

- 3,093
- 1
- 18
- 29
Another alternative is to add AndroidUseIntermediateDesignerFile
inside PropertyGroup
in your android csproj and then remove Resource.designer.cs, that way Resource.designer.cs will be generated inside obj
folder
Example:
<PropertyGroup>
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile>
</PropertyGroup>

- 47
- 1
- 1
- 5
I've found adding the file to git's "unchanged index" can be helpful. But that puts the onus on each developer to add the resource designer file to their unchanged list in their own environment. Any alternative might be to write a "repo clone script" that does it when the repo is cloned.
git update-index --assume-unchanged Resource.Designer.cs
Here is a link to another Stack Overflow question along the same lines: Resource.Designer.cs under git

- 1,928
- 1
- 33
- 38