Bug 22277 - VS: Adding a new Class Library (Xamarin Forms Portable) project does not check project name for invalid chars when auto-generating class
Summary: VS: Adding a new Class Library (Xamarin Forms Portable) project does not chec...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal minor
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-22 01:08 UTC by Rob DeRosa
Modified: 2016-03-16 12:26 UTC (History)
5 users (show)

Tags: vs templates ac
Is this bug a regression?: ---
Last known good build:

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:
Status:
RESOLVED NOT_ON_ROADMAP

Description Rob DeRosa 2014-08-22 01:08:50 UTC
Projects typically contain a . char which is not allowed in a class name. I'm guessing the class name is generated from the project name. Should probably remove invalid class name chars prior.

Steps to reproduce:

1) VS: Add new project -> Class Library (Xamarin Forms Portable)
2) Name it Test.Core
3) Note Test.Core.cs won't compile

XF - 1.2.3.6246


=== Xamarin Studio ===

Version 5.2.1 (build 1)
Installation UUID: 4badb2ca-8346-47f7-81a2-9f260e1254be
Runtime:
	Microsoft .NET 4.0.30319.34014
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: C:\Users\Rob DeRosa\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 502010001
Git revision: d06832ce9807d6be24aca225457e8b37c7669f6f
Build date: 2014-08-07 14:35:09-04
Xamarin addins: 1de032531be4cecf2f39dbee3b87aac78204058c

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 1 Rajneesh Kumar 2014-08-26 02:53:09 UTC
I have checked this issue and able to reproduce. To reproduce this issue I followed the steps mentioned below:

1. Open VS.
2. Create Class Library(Xamarin.Forms.Portable) project
   New Project=>Visual c#=>iOS=>MobileApps=>
Class Library(Xamarin.Forms.Portable)
3. Give project name "Test.Core" and click OK
4. The project will created but it has compile error.

I observed that when the project is created with the name "Test.Core", then class name is generated from project name which causes compile error. If i remove "."(dote) from class name and constructor name then project gets build successfully.

Screencast: http://www.screencast.com/t/88DzbPd66flJ

Environment Info:

Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2012   04938-004-0033001-02837
Microsoft LightSwitch for Visual Studio 2012

Office Developer Tools   04938-004-0033001-02837
Microsoft Office Developer Tools

Team Explorer for Visual Studio 2012   04938-004-0033001-02837
Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012   04938-004-0033001-02837
Microsoft Visual Basic 2012

Visual C# 2012   04938-004-0033001-02837
Microsoft Visual C# 2012

Visual C++ 2012   04938-004-0033001-02837
Microsoft Visual C++ 2012

Visual F# 2012   04938-004-0033001-02837
Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker   04938-004-0033001-02837
Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Visual Studio 2012 SharePoint Developer Tools   04938-004-0033001-02837
Microsoft Visual Studio 2012 SharePoint Developer Tools

ASP.NET and Web Tools   2012.3.41009
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

NuGet Package Manager   2.8.50313.31
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.0
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   11.1.20627.00
Microsoft SQL Server Data Tools

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.3.47.0 (0b2a123923812a88ed3091909478dbe9e0111f00)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android