Skip to content

Instantly share code, notes, and snippets.

@King-of-Spades
Last active August 29, 2015 14:04
Show Gist options
  • Save King-of-Spades/fcf237bc69378e57c069 to your computer and use it in GitHub Desktop.
Save King-of-Spades/fcf237bc69378e57c069 to your computer and use it in GitHub Desktop.
How to Restore a corrupted .csproj file

A bug in X.Studio previously corrupted .csproj files by partially or completely deleting the xml code in the .csproj file. As of the 5.1.4 stable release on July 15th, this bug has been fixed; but in many cases the project file has to be repaired manually, as described below:

Two possible approaches to fixing up the project file

Either:

  1. Create a brand new Xamarin.Android application project, set all the project properties to match your old project, and add all of your resources, source files, etc. back into the project.

OR

  1. Make a backup copy of your original project's .csproj file, then open it in a text editor, and add back in the missing elements from a cleanly generated .csproj file.

If this does not solve the problem

After experimenting with these elements, I noticed that after adding back the elements and rebuilding the project, the Resource.designer.cs file would update, but then I still had to close and re-open the solution to get code completion to recognize the new types contained in Resource.designer.cs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment