4

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?

webwires
  • 2,572
  • 3
  • 26
  • 44

3 Answers3

3

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

Visual Sharp
  • 3,093
  • 1
  • 18
  • 29
1

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>
Yunus Efendi
  • 47
  • 1
  • 1
  • 5
0

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

benhorgen
  • 1,928
  • 1
  • 33
  • 38