4

I'm building an iOS Xamarin app from the command line. The *designer.cs files have been removed.

What command do I run to regenerate the *.designer.cs files?

James Moore
  • 8,636
  • 5
  • 71
  • 90

3 Answers3

2

Encountered in Xamarin Studio 6

Based on this forum thread the fairly awkward sequence that worked for me was

  • rename the ViewController specified in the storyboard
  • save and close the solution
  • remove bin and obj directories
  • rebuild
Andy Dent
  • 17,578
  • 6
  • 88
  • 115
1

There are actually 3 questions in this topic:

  1. If you want to build from command line is explained in this topic: How do you do a command line build of a Xamarin.iOS project?

  2. To ignore *.designer.cs you can add a pattern to your .git file called git ignore: http://git-scm.com/docs/gitignore

  3. To regenerate the designer files you can simply rebuild your solution.

Community
  • 1
  • 1
Martijn00
  • 3,569
  • 3
  • 22
  • 39
  • 5
    I edited the question to make it clear that I'm not asking the first two. And unfortunately, #3 is wrong; there's no mechanism I know about that creates those *designer.cs files at build time. – James Moore Dec 30 '14 at 23:42
0

For Xamarin Studio 5.8, if you edit the file that originated the designer.cs, save again and rebuild the project it will regenerate the designer.cs

  • 1
    Unfortunately, this is not true in 5.9.4. – James Moore Jul 09 '15 at 18:53
  • Another way to go is the creating an empty class and name it with .designer.cs and ensure that contains only the class declaration empty with the Register ("") line over declaration. Then just go to your view and set the Identify>Class Property value with the class inside that .designer.cs – Jorge Wander Santana Ureña Jul 01 '16 at 14:35