Handling Modified Files during Scaffolding

During the scaffolding process, you may see a dialog box that provides an option to retain any updates made to a file in the project after it was initially scaffolded.

This can occur if you made changes to any of the scaffolded files, and then scaffolded the same project again. For instance, you may have designed some of the scaffolded files based on your app requirements. To ensure that any designed files are not overwritten, the scaffolding process compares the creation timestamp of each file with its last updated timestamp. If they are different, then it assumes that the file has been modified, and you are given a chance to retain or discard the changes.

In the Scaffold Xamarin Forms dialog box, for Do you want to overwrite this file?, select No to retain the changes, and select Yes to discard the changes.

After selecting one of these options, you can apply the same selection to subsequent conflicts in the scaffolding process. To do this, select the Apply the same choice to all other modified files checkbox.

Note: This does not work the same on Mac, due to differences in Visual Studio. On Mac, all previously scaffolded files will be overwritten. If you have designed your app after scaffolding, it is strongly recommended to make backups of the project before you perform another scaffolding operation.