'How to stabilize Android Resource.designer.cs file
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?
Solution 1:[1]
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
Solution 2:[2]
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>
Solution 3:[3]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Visual Sharp |
| Solution 2 | Yunus Efendi |
| Solution 3 | benhorgen |
