Bug 56984 - <SubType>Designer</SubType> Problem
Summary: <SubType>Designer</SubType> Problem
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.5
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-31 02:06 UTC by Melbourne Developer
Modified: 2017-09-25 04:26 UTC (History)
5 users (show)

Tags: android, embeddedresource, xaml, 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 for Bug 56984 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Melbourne Developer 2017-05-31 02:06:24 UTC
The <SubType>Designer</SubType> tag inside the EmbeddedResource tag in a csproj can cause Android to fail compilation.

To recreate:

-Pull this repo https://ChristianFindlay@bitbucket.org/ChristianFindlay/xamarin-forms-scratch.git
-Revert to commit 775749f46267752c27ca58c9b580bb20449d9df7
-Do full Git clean
-Open solution Other/Xivic.sln in Visual Studio 2017
-Compile and run Android project
-Notice errors

Now, 

-Close Visual Studio
-Switch code to commit e9b31e122185208e0588ff35020c63a80641e195 
-Full Git Clean
-Open solution again
-Compile and run Android project
-No problem

Notice the different between commits 775749f46267752c27ca58c9b580bb20449d9df7 and e9b31e122185208e0588ff35020c63a80641e195 . The only different is the <SubType>Designer</SubType> which are not even in the Android project.
Comment 1 Melbourne Developer 2017-05-31 02:06:46 UTC
Discussion of bug here:
https://forums.xamarin.com/discussion/comment/275833/#Comment_275833
Comment 2 Colin Phillips 2017-05-31 05:39:16 UTC
With the given errors I suspected that the designer file had an issue due to the resource type property.
On my machine switching the types and compiling in between each self-corrected the issue as I explained in MelbourneDeveloper's thread.
While removing these tags corrected the issue, it is suspect that these lines were generated in the first place.
Comment 3 Melbourne Developer 2017-06-01 01:59:02 UTC
Yes, but the problem isn't so much that the extra lines get added through the IDE, the problem is that if they are there, seemingly random compilation error messages appear. If the tags are invalid for the project type, Visual Studio should validate the project file and complain with a useful error message. Perhaps something along the lines of "Designer is an invalid SubType for a Xamarin Forms XAML file as an EmbeddedResource.".
Comment 4 Jon Douglas [MSFT] 2017-06-27 16:28:40 UTC
(In reply to Melbourne Developer from comment #0)
> The <SubType>Designer</SubType> tag inside the EmbeddedResource tag in a
> csproj can cause Android to fail compilation.
> 
> To recreate:
> 
> -Pull this repo
> https://ChristianFindlay@bitbucket.org/ChristianFindlay/xamarin-forms-
> scratch.git
> -Revert to commit 775749f46267752c27ca58c9b580bb20449d9df7
> -Do full Git clean
> -Open solution Other/Xivic.sln in Visual Studio 2017
> -Compile and run Android project
> -Notice errors
> 
> Now, 
> 
> -Close Visual Studio
> -Switch code to commit e9b31e122185208e0588ff35020c63a80641e195 
> -Full Git Clean
> -Open solution again
> -Compile and run Android project
> -No problem
> 
> Notice the different between commits
> 775749f46267752c27ca58c9b580bb20449d9df7 and
> e9b31e122185208e0588ff35020c63a80641e195 . The only different is the
> <SubType>Designer</SubType> which are not even in the Android project.


Moving this issue for visibility to the Forms product as this seems more dependent on the csproj element <EmbeddedResource>'s property of <SubType> and what gets generated for a XAML file. Perhaps a XAMLC at the assembly level could help this? It does seem to at least see that something inside the Build Action is not supported and gives you a warning, however that warning should be a bit more helpful and straight to the point with regards to the <SubType>.

I am CONFIRMING this bug based on reproduction from https://bugzilla.xamarin.com/show_bug.cgi?id=56984#c0

It seems that with these conflicting items, the Resource.Designer.cs is not regenerating and failing which causes the Android errors to appear. This is because it doesn't seem to even make it to the Aapt task in the first place. However removing these <SubType> properties seem to allow compilation past Aapt and a perfectly fine generated Resource.Designer.cs is present.
Comment 5 Melbourne Developer 2017-09-25 04:26:03 UTC
How is this bug going?