Bug 933 - Parsing error is occurred when user tries to launch Xcode.
Summary: Parsing error is occurred when user tries to launch Xcode.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 2.8 Beta 2
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Alan McGovern
: 934 935 936 ()
Depends on:
Reported: 2011-09-20 14:38 UTC by Atin
Modified: 2011-10-10 12:08 UTC (History)
6 users (show)

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

Image for the bug (199.09 KB, image/jpeg)
2011-09-20 14:38 UTC, Atin

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 Atin 2011-09-20 14:38:22 UTC
Created attachment 447 [details]
Image for the bug

Steps to Reproduce:
1. Open MonoDeveloper interface.
2. Click on "Start a New Solution" link.
3. Select C#> MonoTouch> iPhone from the left hand panel.
4. Select "MonoTouch Single View Application-iPhone" from the center pane.
5. Provide a name and click on "Forward" button.
6. Click on "OK" button.
7. Double click on <projectname>ViewController.xib file.
8. See pop up is displayed stating the parsed error.

Actual result:
Parsing error occurred when user double clicks on <projectname>ViewController.xib file to launch the Xcode. Refer the attached screenshot.

Expected result:
Xcode should be launched without throwing any error.

Environment Details: 
VM: Parallel Desktop 
OS:  Lion 10.7 (Guest Operating System)
MonoTouch 4.9
MonoDevelop 2.8 
Mono Framework for MAC OS X Intel Runtime
Comment 1 Mikayla Hutchinson [MSFT] 2011-09-20 15:12:11 UTC
Is this perhaps caused by a project name with a space in it?
Comment 2 Alan McGovern 2011-09-20 19:30:35 UTC
Looks like it. What's the 'normal' fix for this? Should project names be disallowed if they contain invalid characters like spaces or should they be auto converter to underscores/dashes/whatever when files are being created? Or should MD be able to handle filenames with spaces. This is honestly something I've never come across before ;)
Comment 3 Alan McGovern 2011-09-21 04:50:15 UTC
*** Bug 936 has been marked as a duplicate of this bug. ***
Comment 4 Alan McGovern 2011-09-21 05:30:03 UTC
The issue is that the xib file ends up with a classname with an embedded space, but all class names that MonoDevelop generates do not have spaces in them so there's a mismatch. The fix will be in the next release, we simply disallow spaces in the project name. This will fix all cases where this kind of issue could happen.
Comment 5 Mikayla Hutchinson [MSFT] 2011-09-21 07:18:55 UTC
TBH we need more robust templating. We should be able to ensure we generate a valid obj-c name, and use that in the Register and in the xib. I have some long-term plans for the templating system which would make that possible.
Comment 6 Alan McGovern 2011-09-21 07:29:11 UTC
I did contemplate something like that but i thought it would be very hard to implement as compared to just disallowing spaces. Overworking everything to allow validators to be registered so we could ensure that the name is valid for all the places we want to use it sounded quite complicated. Factor in additional complexity if we started silently modifying what the user typed (such as replacing spaces with underscores automatically when using the name in some places).
Comment 7 Mikayla Hutchinson [MSFT] 2011-09-21 07:39:29 UTC
Yeah, my templating system design basically worked something like this:
* template name is an "input variable"
* "template options" are UI widgets that add more input variables
* "template transformers" transform input variable to "derived variables", for example escaping identifiers, adding suffixes, etc.
* "template validators" validate input/derived variables' values, and errors are displayed by the input widgets
* the variables are passed into the template string substitutions

Instead of subclassing the whole template handler class to add additional functionality to the templating system, as we do right now, we'd be able to add option types, transformers and validators, and let individual templates use them how they wanted.
Comment 8 narayanp 2011-09-22 13:23:29 UTC
We have verified the this issue is occurring when there is space and special character in project name. We have also verified that there is no space in the project path.
Comment 9 Alan McGovern 2011-09-22 18:03:23 UTC
When you said "We have also verified that there is no space in the project path", does that mean the *path* had no space in it but the project name *did* have a space? Or do you mean there were no spaces in the path and no spaces in the project name?

If there are no spaces in the project and no spaces in the path, can you zip the project and attach it to the bug report? I'm not able to reproduce the issue here. Can you also confirm that you're running Xcode 4.2 beta 7? If not, what Xcode version are you using?
Comment 10 Alan McGovern 2011-09-23 12:10:44 UTC
*** Bug 934 has been marked as a duplicate of this bug. ***
Comment 11 Alan McGovern 2011-09-23 12:12:33 UTC
*** Bug 935 has been marked as a duplicate of this bug. ***
Comment 12 Nischal 2011-09-23 12:18:42 UTC
This issue is happening only in the case where we have spaces or Special characters in the File name.

Other than this it is working fine.
Comment 13 Alan McGovern 2011-09-23 12:49:32 UTC
Great. That issue has been resolved so I'll close this then. Thanks!
Comment 14 Alan McGovern 2011-09-27 10:38:20 UTC
*** Bug 1018 has been marked as a duplicate of this bug. ***
Comment 15 Saurabh 2011-10-10 08:11:13 UTC
This is working fine without including space and special characters in project name.hence closing this issue.