Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
XamlC target causes "Error HRESULT E_FAIL has been returned from a call to a COM component." dialog when using "Run Custom Tool" on a XAML file in a UWP project
## Steps to replicate
1. Create a new "Visual C# -> Windows -> Universal -> Blank App (Universal Windows)" in VS 2015 Update 1 on Windows 10. (I used the default ".NET Framework 4.5.2" in the target framework drop-down.)
2. Install the Xamarin.Forms 188.8.131.5229 NuGet package into the project.
3. Close and reopen the solution.
4. Right-click the "App.xaml" file in the UWP project and select "Run Custom Tool".
(Note: If you create the solution using one of the "Visual C# -> Cross-Platform" templates, you will need to build the UWP project once and then clean it. After that you can continue from step 3.)
Visual Studio displays an error dialog:
> Error HRESULT E_FAIL has been returned from a call to a COM component.
## Expected Results
No error dialog.
I suspect the XamlC target is not meant to interfere with how the UWP project treats its _own_ XAML files, but instead only how the build process treats _Xamarin.Forms_ XAML pages?
In any case, I would say it shouldn't cause the "Run Custom Tool" command to fail for XAML files in the UWP project.
## "Partial Workaround"
1. Remove or comment out "XamlC;" from the `<CompileDependsOn>` element in the Xamarin.Forms.targets file , at line 16.
>  $(UserProfile)\.nuget\packages\Xamarin.Forms\184.108.40.20629\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets
2. Close and reopen the solution.
After these steps the "Run Custom Tool" command will no longer produce an error.
## Additional version info (brief)
Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Windows 10 (64-bit)
Tried reproducing it. Looks fixed.
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
## Verification status: verified fixed on Xamarin.Forms 220.127.116.11-pre2
GOOD: Xamarin.Forms 18.104.22.168-pre2
BAD: Xamarin.Forms 22.214.171.12429
There were several changes in `Xamarin.Forms.Build.Tasks.dll` between those 2 versions. One of those changes apparently corrects this problem. (As one additional "hacky" verification, I was able to stop the problem in 126.96.36.19929 by replacing the `Xamarin.Forms.Build.Tasks.dll` file with the corresponding file from 188.8.131.52-pre2.)