Bug 27706 - Excluding a Xamarin.Forms Xaml File and Then Including It Does Not Work as Expected
Summary: Excluding a Xamarin.Forms Xaml File and Then Including It Does Not Work as Ex...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-05 11:18 UTC by Michael
Modified: 2016-09-16 12:57 UTC (History)
4 users (show)

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 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 Michael 2015-03-05 11:18:03 UTC

With the latest Xamarin.Forms, if I add Xamarin.Forms Xaml file to a project, its File Properties (displayed in Properties Pane) is:
Build Action: Embedded Resource
Compile: MSBuild:UpdateDesignTimeXaml

However, if I right-click the .xaml file, select "Exclude From Project" and then right-click it again, selecting "Include In Project", its File Properties display as:
Build Action: Page
Compile: MSBuild:Compile

I would expect that the file properties would be the original default values that are specified when adding this item to the project initially.

Please let me know if you have any further questions around this and I will try to answer them the best that I can.

Thank you,
Comment 1 Daniel Cazzulino 2016-05-16 18:28:11 UTC
In Xamarin.Forms apps, the XAML files will live inside the PCL projects. The place where this default behavior exists is in the project system, so we can't override it for PCLs.

Pretty much the same happens with Shared Asset projects, we don't provide that project system either.

I'll pass this along to the respective teams to see if we can tweak this behavior from our Xamarin targets moving forward. 

Thanks a lot for reporting it!