Bug 46272 - Build error when project contains Xamarin in name
Summary: Build error when project contains Xamarin in name
Status: RESOLVED DUPLICATE of bug 43301
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.2
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-01 21:36 UTC by eusebiu.marcu
Modified: 2017-01-25 08:44 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: No
Last known good build:


Attachments
test project (7.36 KB, application/zip)
2016-11-01 21:36 UTC, eusebiu.marcu
Details


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 DUPLICATE of bug 43301

Description eusebiu.marcu 2016-11-01 21:36:17 UTC
Created attachment 18291 [details]
test project

A compile time build error is shown when the project name (XF PCL Library) contains 'Xamarin' in its name.

Steps to reproduce (demo project attached):
1. create a XF PCL Library and name it Test.Xamarin.Forms.Error
2. Add a ContentView with XAML - this is important
3. Build the project
4. Error appears.
Comment 1 Matt Ward 2016-11-16 17:10:50 UTC
There are two problems here.

1) New project template creates a class named after the project so you get an invalid class name which does not compile:

class Test.Xamarin.Forms.Error

2) Deleting the default page and creating a new content view with xaml you get build errors due to the namespace Xamarin.Forms.Xaml not being found. This just looks like a namespace clash.

namespace Test.Xamarin.Forms.Error {
    using System;
    using Xamarin.Forms;
    using Xamarin.Forms.Xaml;
...

To fix this we can use the global:: prefix which is used elsewhere in the generated code.

namespace Test.Xamarin.Forms.Error {
    using System;
    using Xamarin.Forms;
    using global::Xamarin.Forms.Xaml;

I will open a separate bug for problem 1) since it is not the original problem the sample test project has which is problem 2).
Comment 2 Stephane Delcroix 2017-01-25 08:44:24 UTC
closing as a dupe.
the issue is already fixed and released in the 2.3.4-pre series

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