Bug 14121 - Ampersand in CodesignKey causes "Saved failed. A name did start with a legal character"
Summary: Ampersand in CodesignKey causes "Saved failed. A name did start with a legal ...
Status: RESOLVED DUPLICATE of bug 17
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 4.1.8
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Lluis Sanchez
: 14322 ()
Depends on:
Reported: 2013-08-20 16:22 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2013-09-03 14:55 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Full error message (9.24 KB, text/plain)
2013-08-20 16:22 UTC, Brendan Zagaeski (Xamarin Team, assistant)

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-08-20 16:22:28 UTC
Created attachment 4674 [details]
Full error message

Reported on behalf of a user.

## Steps to reproduce
If you don't have an "iPhone Distribution" certificate with an ampersand in the name, you can use a self-signed certificate: "Keychain Access -> Certificate Assistant -> Create a Certificate". Name it something like "iPhone Distribution: One & Two".

1. Create a new iPhone project in Xamarin Studio.

2. In Project Options -> Build -> iOS Bundle Signing, set "Identity" to a certificate that includes an ampersand in the name (e.g., "Distribution: One & Two").

3. Select "OK".

## Result

System.Xml.XmlException: a name did not start with a legal character 32 ( )  Line 1, position 27.
  at Mono.Xml2.XmlTextReader.ReadName (System.String& prefix, System.String& localName) [0x0011f] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/System.XML/System.Xml/XmlTextReader.cs:2714

## Expected Result

No error. Ampersands are valid in `codesign` identities:
codesign -s 'iPhone Distribution: One & Two' MyApp.app

## Version info

Xamarin Studio
Version 4.1.9 (build 6)
Installation UUID: 56ba69da-7d25-4701-8c26-6a6e240910f5
	Mono 3.2.1 ((no/f3f789e)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (
	Package version: 302010001

Version: (Business Edition)
Hash: 5a0fe54
Build date: 2013-30-07 08:24:03-0400

Mac OS X 10.7.5
Comment 1 Jeffrey Stedfast 2013-08-29 22:04:20 UTC
*** Bug 14322 has been marked as a duplicate of this bug. ***
Comment 2 Jeffrey Stedfast 2013-08-29 22:13:08 UTC
Looks like the Project Model code isn't serializing the CodesignKey property to XML correctly

Comment 3 Lluis Sanchez 2013-08-30 03:29:43 UTC
Jeff, have you verified if this happens on master? I think it could be already fixed.
Comment 4 Mikayla Hutchinson [MSFT] 2013-09-03 14:55:25 UTC

*** This bug has been marked as a duplicate of bug 17 ***