Bug 35204 - Generated .g.cs files for XAML have incorrect namespace for custom ContentViews
Summary: Generated .g.cs files for XAML have incorrect namespace for custom ContentViews
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-10-23 10:24 UTC by John Miller [MSFT]
Modified: 2015-10-23 12:08 UTC (History)
3 users (show)

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

Sample Project (7.54 KB, application/zip)
2015-10-23 10:24 UTC, John Miller [MSFT]

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 John Miller [MSFT] 2015-10-23 10:24:26 UTC
Created attachment 13505 [details]
Sample Project


   After updating from 1.5.0, the generated .g.cs files for XAML views are generating with a namespace of global::Xamarin.Forms.

**Steps to Reproduce:**

   1. Build the attached PCL in XS on a Mac

**Actual Results:**

   Build error, similar to:

*.xaml.g.cs(64,64): Error CS0234: The type or namespace name `CustomView' does not exist in the namespace `Xamarin.Forms'. Are you missing an assembly reference? (CS0234)

**Expected Results:**

   The generated file should use the projects namespace where the "CustomView" lives, and not generate the .g.cs file with a Xamarin.Forms namespace. 

**Build Date & Platform:**

   XF 1.5.1 - XF 1.5.2-pre1

**Additional Information:**

   Downgrade the project back to Xamarin.Forms 1.5.0, and the issue goes away.
Comment 1 John Miller [MSFT] 2015-10-23 12:08:25 UTC
Possibly related to whatever bug was fixed mentioned here: http://forums.xamarin.com/discussion/comment/160024/#Comment_160024

It seems the XAML is wrong in this sample, and needs to be update to this: 

<local:GOContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:FormsTesting" x:Class="FormsTesting.CostLevelView">

Note* Added the "local" prefix and xmlns definition.