Bug 29662 - "Error HRESULT E_FAIL has been returned from a call to a COM component" when initialising Windows app
Summary: "Error HRESULT E_FAIL has been returned from a call to a COM component" when ...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.4
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2015-05-01 13:22 UTC by John Hardman
Modified: 2017-08-18 21:51 UTC (History)
9 users (show)

Tags: windows store exception initialization ac
Is this bug a regression?: ---
Last known good build:


Attachments
Zip file containing procmon (SysInternals) trace filtered to BoxViewClock process only (572.83 KB, application/octet-stream)
2015-06-02 11:23 UTC, John Hardman
Details
Zip file containing bin folder for BoxViewBlock (732.26 KB, application/octet-stream)
2015-06-02 11:29 UTC, John Hardman
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 NOT_ON_ROADMAP

Description John Hardman 2015-05-01 13:22:53 UTC
Running Windows (not Windows Phone) apps results in an exception, with the following stack trace. The inner exception seems to be "Error HRESULT E_FAIL has been returned from a call to a COM component".

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n
 at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification)\r\n
   at System.Threading.Tasks.Task
1.get_Result()\r\n
 at Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies()\r\n
 at Xamarin.Forms.Device.GetAssemblies()\r\n
 at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)\r\n
 at Xamarin.Forms.Forms.Init(LaunchActivatedEventArgs launchActivatedEventArgs)\r\n
 at WinUniversal.App.OnLaunched(LaunchActivatedEventArgs e)" string 

Whether it's my own solution, or one of the samples, such as the Working with Colors sample ( https://github.com/conceptdev/xamarin-forms-windows-preview ) or the Hanselman app, they all fail in the same way.

I'm running on a 64 bit Windows 8.1 machine. I have a Windows Developer license etc all set up.

Packages.config contains
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Xamarin.Forms" version="1.4.2.6359" targetFramework="win81" />
</pack

This matches the actual contents of the Packages folder.
Comment 1 Eric Maupin 2015-05-27 12:36:40 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there. 

Warm regards,
Xamarin Forms Team
Comment 2 John Hardman 2015-05-29 05:56:23 UTC
Any of the samples demonstrate this. I have just repeated it using the Box View Clock example, downloaded today (29th May 2015) from https://github.com/conceptdev/xamarin-forms-windows-preview

Note that the failure happens when running/debugging locally on my 64 bit Windows 8.1 machine. If I do an x86 build and run remotely on my Windows 10 tablet, that does work.

The exception being thrown when running on 64 bit Windows 8.1 has the following stack trace:

System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies()
   at Xamarin.Forms.Device.GetAssemblies()
   at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)
   at Xamarin.Forms.Forms.Init(LaunchActivatedEventArgs launchActivatedEventArgs)
   at BoxViewClock.WinApp.App.OnLaunched(LaunchActivatedEventArgs e)
---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.<---

Prior to that the Output window of Visual Studio 2013 shows:

'BoxViewClock.WinApp.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'E:\BoxViewClock\BoxViewClock\BoxViewClock.WinApp\bin\x64\Debug\AppX\BoxViewClock.WinApp.exe'. Symbols loaded.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.UI.Xaml.winmd'. Module was built without symbols.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.Foundation.winmd'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime.UI.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.UI.Xaml.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.UI.winmd'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Debug\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Debug.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.Globalization.winmd'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'E:\BoxViewClock\BoxViewClock\BoxViewClock.WinApp\bin\x64\Debug\AppX\Xamarin.Forms.Platform.WinRT.Tablet.DLL'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'E:\BoxViewClock\BoxViewClock\BoxViewClock.WinApp\bin\x64\Debug\AppX\Xamarin.Forms.Platform.WinRT.DLL'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'E:\BoxViewClock\BoxViewClock\BoxViewClock.WinApp\bin\x64\Debug\AppX\Xamarin.Forms.Core.DLL'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Threading.Tasks\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.Tasks.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IO\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.IO.dll'. Module was built without symbols.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Reflection\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Reflection.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ObjectModel\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.ObjectModel.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Collections\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Linq.Expressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.Expressions.dll'. Module was built without symbols.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Threading\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.Graphics.winmd'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Linq\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Extensions.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Reflection.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Reflection.Extensions.dll'. Module was built without symbols.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Threading.Timer\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.Timer.dll'. Module was built without symbols.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\system32\WinMetadata\Windows.Storage.winmd'. Cannot find or open the PDB file.
A first chance exception of type 'System.AggregateException' occurred in mscorlib.dll
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.DLL'. 
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Cannot find or open the PDB file.
'BoxViewClock.WinApp.exe' (CLR v4.0.30319: Immersive Application Domain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Cannot find or open the PDB file.

A capture of the details in the Debug window at the time the exception is thrown shows:

+		sender	{BoxViewClock.WinApp.App}	object {BoxViewClock.WinApp.App}
-		e	{Windows.UI.Xaml.UnhandledExceptionEventArgs}	Windows.UI.Xaml.UnhandledExceptionEventArgs
-		Exception	Count = 1	System.Exception {System.AggregateException}
+		[System.AggregateException]	Count = 1	System.AggregateException
		_className	"System.AggregateException"	string
+		_data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		_dynamicMethods	null	object
		_exceptionMethod	null	System.Reflection.MethodBase
		_exceptionMethodString	null	string
		_helpURL	null	string
		_HResult	-2146233088	int
-		_innerException	{"Error HRESULT E_FAIL has been returned from a call to a COM component."}	System.Exception {System.Runtime.InteropServices.COMException}
+		[System.Runtime.InteropServices.COMException]	{"Error HRESULT E_FAIL has been returned from a call to a COM component."}	System.Runtime.InteropServices.COMException
		_className	"System.Runtime.InteropServices.COMException"	string
		_data	null	System.Collections.IDictionary
		_dynamicMethods	null	object
		_exceptionMethod	null	System.Reflection.MethodBase
		_exceptionMethodString	null	string
		_helpURL	null	string
		_HResult	-2147467259	int
+		_innerException	null	System.Exception
+		_ipForWatsonBuckets	0	System.UIntPtr
		_message	"Error HRESULT E_FAIL has been returned from a call to a COM component."	string
		_remoteStackIndex	0	int
		_remoteStackTraceString	null	string
+		_safeSerializationManager	{System.Runtime.Serialization.SafeSerializationManager}	System.Runtime.Serialization.SafeSerializationManager
		_source	null	string
		_stackTrace	null	object
		_stackTraceString	null	string
		_watsonBuckets	null	object
		_xcode	-532462766	int
+		_xptrs	0	System.IntPtr
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		HelpLink	null	string
		HResult	-2147467259	int
+		InnerException	null	System.Exception
+		IPForWatsonBuckets	0	System.UIntPtr
		IsTransient	false	bool
		Message	"Error HRESULT E_FAIL has been returned from a call to a COM component."	string
		RemoteStackTrace	null	string
		Source	null	string
		StackTrace	null	string
		TargetSite	null	System.Reflection.MethodBase
		WatsonBuckets	null	object
+		Static members		
+		_ipForWatsonBuckets	140711592656792	System.UIntPtr
		_message	"One or more errors occurred."	string
		_remoteStackIndex	0	int
		_remoteStackTraceString	null	string
+		_safeSerializationManager	{System.Runtime.Serialization.SafeSerializationManager}	System.Runtime.Serialization.SafeSerializationManager
		_source	null	string
+		_stackTrace	{sbyte[384]}	object {sbyte[]}
		_stackTraceString	null	string
		_watsonBuckets	null	object
		_xcode	-532462766	int
+		_xptrs	0	System.IntPtr
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		HelpLink	null	string
		HResult	-2146233088	int
+		InnerException	{"Error HRESULT E_FAIL has been returned from a call to a COM component."}	System.Exception {System.Runtime.InteropServices.COMException}
+		IPForWatsonBuckets	140711592656792	System.UIntPtr
		IsTransient	false	bool
		Message	"One or more errors occurred."	string
		RemoteStackTrace	null	string
		Source	"mscorlib"	string
		StackTrace	"   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies()\r\n   at Xamarin.Forms.Device.GetAssemblies()\r\n   at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)\r\n   at Xamarin.Forms.Forms.Init(LaunchActivatedEventArgs launchActivatedEventArgs)\r\n   at BoxViewClock.WinApp.App.OnLaunched(LaunchActivatedEventArgs e)"	string
+		TargetSite	{TResult GetResultCore(Boolean)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
		WatsonBuckets	null	object
+		Static members		
		Handled	false	bool
		Message	"System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies()\r\n   at Xamarin.Forms.Device.GetAssemblies()\r\n   at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)\r\n   at Xamarin.F"	string
Comment 3 John Hardman 2015-05-29 05:59:20 UTC
Let me know if you want me to capture a procmon trace to assist in diagnosis.

For me, this wants to be a Critical severity bug, as not being able to run on an x64 desktop pretty much defeats the usefulness of Xamarin Forms for Windows.
Comment 4 Eric Maupin 2015-05-29 15:48:26 UTC
I downloaded the sample and tried it on x64 Windows 8.1 and Windows 10 and was unable to reproduce it with both an x86 build and explicitly x64.

> Let me know if you want me to capture a procmon trace to assist in diagnosis.

Yes, please. The stack trace in question is fairly file oriented, so there might be an environmental difference.

If you could also zip one of the samples you've tried with the app package that it built, we'd like to try the package locally to see if perhaps there's a build difference.
Comment 5 John Hardman 2015-06-02 11:23:23 UTC
Created attachment 11429 [details]
Zip file containing procmon (SysInternals) trace filtered to BoxViewClock process only

The attached file contains a (SysInternals) procmon trace filtered to show only those entries associated with the BoxViewClock process.

I will try to also attach an un-filtered zip, but suspect it will be too large.
Comment 6 John Hardman 2015-06-02 11:29:30 UTC
Created attachment 11430 [details]
Zip file containing bin folder for BoxViewBlock

Zip file containing the entire bin folder for BoxViewClock which fails on 64 bit Windows 8.1 box.
Comment 7 John Hardman 2015-06-08 04:26:08 UTC
Changed to New as per a comment in the forums, saying that when responding to NEEDINFO that should set back to New.
Comment 8 John Hardman 2015-07-04 06:19:17 UTC
Is there any update on this? This is critical for me, as until solved, apps (not just mine) work on some Windows machines but not others (including my main Dev PC).

Even if you haven't got a solution yet, there really needs to be more diagnostics in this area of code, so that if a similar problem occurs on a production device, there is some way of diagnosing it there (if it cannot be diagnosed on a developer machine with lots of debugging tools, it will be impossible on a production machine with a release build).
Comment 9 John Hardman 2015-08-18 09:26:55 UTC
Just to confirm, I am now using XF 1.4.4.6392 and the problem is still occurring. Stack trace below:

System.AggregateException was unhandled by user code
  HResult=-2146233088
  Message=One or more errors occurred.
  Source=mscorlib
  StackTrace:
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies()
       at Xamarin.Forms.Device.GetAssemblies()
       at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)
       at Xamarin.Forms.Forms.Init(LaunchActivatedEventArgs launchActivatedEventArgs)
       at Kaekwondo.StoreAppWindows.App.OnLaunched(LaunchActivatedEventArgs e)
  InnerException: System.Runtime.InteropServices.COMException
       HResult=-2147467259
       Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
       ErrorCode=-2147467259
       InnerException:
Comment 10 John Hardman 2015-08-18 09:27:31 UTC
Updated version number to latest version tested against that still shows this problem.
Comment 11 John Hardman 2015-08-27 11:41:28 UTC
Any update on this? If nothing being done before then, will the next stable XF release contain more information to identify what is happening within Xamarin.Forms.Platform.WinRT.WindowsBasePlatformServices.GetAssemblies() when this problem occurs?

Or can you make the source of the GetAssemblies() method available to me, to see if I can identify what the cause might be?
Comment 12 Miljenko Cvjetko Mel 2015-09-18 10:14:26 UTC
# Xamarin. Forms Visual Studio Error HRESULT E_FAIL has been returned from a call to a COM component

*	Xamarin.Forms app 3 platform 20 pages/Views 		
*	Xamarin.Forms app for Prototyping and Test of UX		
*	minimal c# code (Business Logic) only POCOs for Databinding			
*	heavy use of BoxView instead of images (artwork not finished yet)
*	The code is from Croatian customer so I cannot share it w/o permission.		

Steps:

1.	start Xamarin.Forms Windows Phone 8 application 
2.	SplashScreen loads
3.	Debugger breaks on Xamarin.Forms.Init()

Plan:

1.	removal of BoxView		
	I will report results		
2.	minimal sample		
	already tried simple sample with BoxView  - works		


## NuGet Packages

Potable:

  <package id="Xamarin.Forms" version="1.5.0.6446" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" />

Android:

  <package id="Xamarin.Android.Support.v4" version="22.2.1.0" targetFramework="MonoAndroid51" />
  <package id="Xamarin.Forms" version="1.5.0.6446" targetFramework="MonoAndroid51" />

iOS:

  <package id="Xamarin.Forms" version="1.5.0.6446" targetFramework="xamarinios10" />

Windows Phone:

  <package id="WPtoolkit" version="4.2013.08.16" targetFramework="wp80" />
  <package id="Xamarin.Forms" version="1.5.0.6446" targetFramework="wp80" />

  
  
## Visual Studio 2013 Community

Exception:

	An exception of type 'System.Exception' occurred in System.Windows.ni.dll 
	but was not handled in user code

	Additional information:
	Error HRESULT E_FAIL has been returned from a call to a COM component.

Exception details:
	
	System.Exception was unhandled by user code
	  HResult=-2146233088
	  Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
	  Source=System.Windows
	  StackTrace:
		   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
		   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
		   at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
		   at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
		   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
		   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
		   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
		   at System.Windows.ResourceDictionary.set_Source(Uri value)
		   at Xamarin.Forms.Forms.Init()
		   at In2.KamApp.WinPhone.MainPage..ctor()
	  InnerException: 
	
Output:	  
	
	'TaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\In2.KamApp.WinPhone.DLL'. Symbols loaded.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\WinMetadata\Windows.winmd'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\Xamarin.Forms.Platform.WP8.DLL'. Module was built without symbols.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\In2.KamApp.DLL'. Symbols loaded.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\Xamarin.Forms.Core.DLL'. Module was built without symbols.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ObjectModel.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Collections.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Linq.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\System.Windows.Interactivity.DLL'. Cannot find or open the PDB file.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Threading.Tasks.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.IO.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Reflection.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Linq.Expressions.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
	A first chance exception of type 'System.Exception' occurred in System.Windows.ni.dll
	
IDE info:

	Microsoft Visual Studio Community 2013
	Version 12.0.40629.00 Update 5
	Microsoft .NET Framework
	Version 4.6.00081

	Installed Version: Professional

	Team Explorer for Visual Studio 2013   06177-004-0444002-02033
	Microsoft Team Explorer for Visual Studio 2013

	Visual Basic 2013   06177-004-0444002-02033
	Microsoft Visual Basic 2013

	Visual C# 2013   06177-004-0444002-02033
	Microsoft Visual C# 2013

	Visual C++ 2013   06177-004-0444002-02033
	Microsoft Visual C++ 2013

	Visual F# 2013   06177-004-0444002-02033
	Microsoft Visual F# 2013

	Visual Studio 2013 Code Analysis Spell Checker   06177-004-0444002-02033
	Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

	Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

	The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

	Windows Phone SDK 8.0 - ENU   06177-004-0444002-02033
	Windows Phone SDK 8.0 - ENU

	Application Insights Tools for Visual Studio Package   1.0
	Application Insights Tools for Visual Studio

	ASP.NET and Web Tools   12.5.60612.0
	Microsoft Web Developer Tools contains the following components:
	Support for creating and opening ASP.NET web projects
	Browser Link: A communication channel between Visual Studio and browsers
	Editor extensions for HTML, CSS, and JavaScript
	Page Inspector: Inspection tool for ASP.NET web projects
	Scaffolding: A framework for building and running code generators
	Server Explorer extensions for Microsoft Azure Web Apps
	Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

	ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
	For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

	ASP.NET Web Frameworks and Tools 2013   5.2.30612.0
	For additional information, visit http://www.asp.net/

	Common Azure Tools   1.4
	Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

	Microsoft Azure Mobile Services Tools   1.4
	Microsoft Azure Mobile Services Tools

	NuGet Package Manager   2.8.60610.756
	NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

	PreEmptive Analytics Visualizer   1.2
	Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

	SQL Server Data Tools   12.0.41012.0
	Microsoft SQL Server Data Tools

	VsCommandBuddy   1.0
	Extend Visual Studio with external commands per solution/project.

	VSCommands for Visual Studio 2013   12.0
	VSCommands for Visual Studio 2013

	Web Essentials 2013   2.6.13.0
	Adds many useful features to Visual Studio for web developers.

	Xamarin   4.0.0.1111 (a1dc0d5)
	Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

	Xamarin.Android   5.1.99.653 (cfa43bb)
	Visual Studio plugin to enable development for Xamarin.Android.

	Xamarin.iOS   8.13.0.122 (2c6a530)
	Visual Studio extension to enable development for Xamarin.iOS.

## Visual Studio 2015 Community

Exception

	An exception of type 'System.Exception' occurred in System.Windows.ni.dll 
	but was not handled in user code

	Additional information: 
	Error HRESULT E_FAIL has been returned from a call to a COM component.

Exception details:
	
	System.Exception was unhandled by user code
	  HResult=-2146233088
	  Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
	  Source=System.Windows
	  StackTrace:
		   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
		   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
		   at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
		   at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
		   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
		   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
		   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
		   at System.Windows.ResourceDictionary.set_Source(Uri value)
		   at Xamarin.Forms.Forms.Init()
		   at In2.KamApp.WinPhone.MainPage..ctor()
	  InnerException: 

Output:	  
	  
	'TaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\In2.KamApp.WinPhone.DLL'. Symbols loaded.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\WinMetadata\Windows.winmd'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\Xamarin.Forms.Platform.WP8.DLL'. Module was built without symbols.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\In2.KamApp.DLL'. Symbols loaded.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\Xamarin.Forms.Core.DLL'. Module was built without symbols.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ObjectModel.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Collections.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Linq.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{EC495A32-938E-4528-8F1E-5344E2EA1343}\Install\System.Windows.Interactivity.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Threading.Tasks.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.IO.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Reflection.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Linq.Expressions.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
	'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
	Exception thrown: 'System.Exception' in System.Windows.ni.dll

IDE info:

	Microsoft Visual Studio Community 2015
	Version 14.0.23107.0 D14REL
	Microsoft .NET Framework
	Version 4.6.00081

	Installed Version: Community

	Visual Basic 2015   00322-20000-00000-AA727
	Microsoft Visual Basic 2015

	Visual C# 2015   00322-20000-00000-AA727
	Microsoft Visual C# 2015

	Visual C++ 2015   00322-20000-00000-AA727
	Microsoft Visual C++ 2015

	Visual F# 2015 RC   00322-20000-00000-AA727
	Microsoft Visual F# 2015 RC

	Windows Phone SDK 8.0 - ENU   00322-20000-00000-AA727
	Windows Phone SDK 8.0 - ENU

	ASP.NET and Web Tools   14.0.20626.0
	ASP.NET and Web Tools

	ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
	For additional information, visit http://www.asp.net/

	Common Azure Tools   1.5
	Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

	GenerateUnitTest   1.0
	Generates unit test code for methods in classes under test.

	GitHub.VisualStudio   1.0
	A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

	Microsoft Azure Mobile Services Tools   1.4
	Microsoft Azure Mobile Services Tools

	Microsoft MI-Based Debugger   1.0
	Provides support for connecting Visual Studio to MI compatible debuggers

	NuGet Package Manager   3.0.0
	NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

	PreEmptive Analytics Visualizer   1.2
	Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

	Python Tools for Visual Studio   2.2.30718.00
	Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

	Python Tools for Visual Studio - Django Integration   2.2.30718.00
	Provides templates and integration for the Django web framework.

	Python Tools for Visual Studio - Profiling Support   2.2.30718.00
	Profiling support for Python projects.

	SQL Server Data Tools   14.0.50616.0
	Microsoft SQL Server Data Tools

	Visual C++ for Cross Platform Mobile Development   1.0
	Visual C++ for Cross Platform Mobile Development

	Visual C++ for Cross Platform Mobile Development   1.0
	Visual C++ for Cross Platform Mobile Development

	VsEssentials   1.1
	Essential features missing in Visual Studio.

	Xamarin   4.0.0.1111 (a1dc0d5)
	Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

	Xamarin.Android   5.1.99.653 (cfa43bb)
	Visual Studio plugin to enable development for Xamarin.Android.

	Xamarin.iOS   8.13.0.122 (2c6a530)
	Visual Studio extension to enable development for Xamarin.iOS.
	
	
## References/Links

*	[https://bugzilla.xamarin.com/show_bug.cgi?id=29662](https://bugzilla.xamarin.com/show_bug.cgi?id=29662)
	
	
## Further Information

*	[https://github.com/moljac/Xamarin.Tools.Tests/tree/master/logs/2015-09-17%5BXamarin.Forms-Visual%20Studio%20-%20HRESULT%20E_FAIL%20has%20been%20returned%20from%20a%20call%20to%20a%20COM%20component.%5D](https://github.com/moljac/Xamarin.Tools.Tests/tree/master/logs/2015-09-17%5BXamarin.Forms-Visual%20Studio%20-%20HRESULT%20E_FAIL%20has%20been%20returned%20from%20a%20call%20to%20a%20COM%20component.%5D)
Comment 13 John Miller [MSFT] 2016-01-04 18:48:59 UTC
I am not able to reproduce with the BoxViewClock sample and XF 2.0.
Comment 14 Shawn 2016-01-23 15:09:41 UTC
Try validating that you have a reference to one of these assemblies

C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Windows Phone\v8.0\Libraries\System.Windows.Interactivity.dll

or

C:\Program Files (x86)\Microsoft SDKs\Expression\Blend.NETFramework\v4.5\System.Windows.Interactivity.dl
Comment 15 Alexander Pacha 2016-03-05 22:23:00 UTC
I was able to reproduce this issue with these steps:

- Create a new Xamarin Forms (Shared) Project
- Remove the MainPage (xaml + cs)
- Open App.xaml.cs and comment out the lines, where MainPage is used
- Start the application

--> This will crash the application, when Forms.Init is being called. Restoring the MainPage.xaml/cs will fix the issue.

I've uploaded a project to github, where I have followed these steps and successfully reproduced this bug: https://github.com/apacha/XamarinFormsInitCrasher
Comment 16 John Hardman 2016-10-03 11:43:08 UTC
Changed status from NEEDINFO back to NEW as Alexander Pacha has supplied a repro project.
Comment 17 Paul DiPietro [MSFT] 2017-03-16 18:36:26 UTC
At a cursory glance the reproduction does reproduce the error on my machine after updating to the latest prerelease (2.3.4-pre5).
Comment 18 Chris King 2017-05-05 20:20:13 UTC
Windows 8.1 support will soon be deprecated.
Comment 19 Milen Marinov 2017-08-18 21:51:34 UTC
Why is this problem NOT_ON_ROADMAP ?