Bug 22019 - XamlParseException: No embeddedresources found
Summary: XamlParseException: No embeddedresources found
Status: RESOLVED DUPLICATE of bug 21111
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Xamarin.Forms Add-in ()
Version: 5.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Jason Smith [MSFT]
URL:
: 22213 ()
Depends on:
Blocks:
 
Reported: 2014-08-11 16:57 UTC by Jon Douglas [MSFT]
Modified: 2015-01-14 02:52 UTC (History)
8 users (show)

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


Attachments
Behavior of Bug (343.81 KB, image/png)
2014-08-11 16:57 UTC, Jon Douglas [MSFT]
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 21111

Description Jon Douglas [MSFT] 2014-08-11 16:57:06 UTC
Created attachment 7662 [details]
Behavior of Bug

I get a XamlParseException with message: No embeddedresources found. Many times the
problem goes away by building and running again - however any change will
introduce the problem again. It's basically driving me crazy. I have made a
minimal test-case below:

I have also tried to update packages - but with same result (there is an
update to Forms package when I create the project).

*Steps to reproduce:*
1. New solution -> Blank App (Xamarin.Forms.Portable) (called FormTest)
2. Set FormTest.iOS as Startup Project
3. Add new file -> Forms ContentPage Xaml to FormTest project (called
TestPage)
4. Return new TestPage (); in GetMainPage mehod in App.cs
5. Add: <BoxView Color="#888" /> between <ContentPage.Content> and </
ContentPage.Content> in TestPage.xaml
6. Run in simulator -> Xamarin.Forms.Xaml.XamlParseException with message:
No embeddedresources found for FormTest.TestPage
7. Stop debugging
8. Run again -> no exception.

Notice space between .."#888" and /> in BoxView element.

9. Remove space between "#888" and /> in BoxView element.
10. Run in simulator -> Xamarin.Forms.Xaml.XamlParseException with message:
No embeddedresources found for FormTest.TestPage
11. Stop debugging
12. Run again -> no exception.

Reproduce exception again by introducing space in element.

=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: a5e4c0db-146d-4f57-bd7c-1d5258af38a9
Runtime:
Mono 3.6.0 ((no/f540f8a)
GTK+ 2.24.23 (Raleigh theme)

Package version: 306000039

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.Mac ===

Version:

=== Xamarin.iOS ===

Version: 7.2.6.28 (Business Edition)
Hash: 606f31a
Branch:
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Android ===

Version: 4.14.0 (Business Edition)
Android SDK: /Users/amor/Library/Developer/Xamarin/android-sdk-mac_x86
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.2 (API level 17)
4.4 (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Mac OS X 10.9.4
Darwin Macintosh.local 13.3.0 Darwin Kernel Version 13.3.0
Tue Jun 3 21:27:35 PDT 2014
root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 1 Jon Douglas [MSFT] 2014-08-11 16:57:30 UTC
Addendum: I found a work-around:

If I save the Xaml file before running/building then it works. Apparently
the auto-generated file is generated on save event (status window is
updated with "Generated file successfully" when saving with CMD+S) - but
perhaps another save event is done when auto-saving files before running a
build?

Addendum 2:

You can reproduce the problem with the XamlSamples solution downloaded from
your site. Except: I get a different error: "Error in custom tool" when
trying to build.

Same procedure:
1. Edit any .xaml file - DO NOT SAVE
2. Build -> Error in custom tool
3. Build again -> No error

I guess same problem manifested a different way.
Comment 2 Rajneesh Kumar 2014-08-12 04:35:11 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps mentioned in bug description. I observed that when I make any changes to XAML file and I run the project then exception(XamlParseException with message:No embeddedresources found for FormTest2.TestPage) occurs after that I stopped debugging and run again its work fine. I also observed that if I make changes to XAML file and save it before running then there is no exception and its work fine.

Screencast : http://www.screencast.com/t/9H2L6mCxcS

Environment Info:
=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.6.0 ((no/f540f8a)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000039

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		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: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.6.28 (Enterprise Edition)
Hash: 606f31a
Branch: 
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Mac ===

Version: 1.10.0.4 (Enterprise Edition)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 3 Rajneesh Kumar 2014-08-20 02:25:06 UTC
*** Bug 22213 has been marked as a duplicate of this bug. ***
Comment 5 Magnus Johansson 2014-09-24 14:29:26 UTC
This is still present in stable channel v5.3. As soon as I edit a XAML file, I get this error. 
See screencast: http://www.screencast.com/t/K4KXV9m5xNX

(no, I can't update to 5.4, because then I will be hit by yet another Xamarin bug, [Bug 22556] MT9008 with Indie license), I'm stuck with 5.3
Comment 6 Alan McGovern 2014-10-13 16:09:31 UTC
I looked into it and have figured out this much:

Forms is using 'MSBuild:Compile' as the generator. This is a direct invocation to the 'Compile' target which bypasses the normal 'Build' target. The normal build target is the one responsible for gathering the EmbeddedResource objects and preparing them for the compiler. As such this approach can never work.

From the XS logs it seems like a solution has already been provided by Michael so we just need to move to that.
Comment 7 Lluis Sanchez 2014-10-27 07:32:21 UTC

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