Bug 57311 - ToolbarItem without icon throws exception in UWP when the rootelement is something other than a Frame
Summary: ToolbarItem without icon throws exception in UWP when the rootelement is some...
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-06-09 10:14 UTC by TheBigRic
Modified: 2017-06-21 13:26 UTC (History)
2 users (show)

Tags: ac, uwp, toolbaritem
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 57311 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:

Description TheBigRic 2017-06-09 10:14:14 UTC
# Steps to reproduce
I created a repo of the issue here: https://github.com/TheBigRic/UWP-Xamarin-test

Basically the reproduction is creating a master-detail example from the VS2017 templates. 
Change the template code in App.xaml.cs of the UWP project from this:

Frame rootFrame = Window.Current.Content as Frame;

if (rootFrame == null)
    rootFrame = new Frame();
    Window.Current.Content = rootFrame;

if (rootFrame.Content == null)
    rootFrame.Navigate(typeof(MainPage), e.Arguments);

to this:

Window.Current.Content = new MainPage();

Hit F5

The App will crash with an unhandled exception, without stacktrace nor inner exceptions. 
The exception is a `DirectoryNotFoundException` with as message:
The system cannot find the path specified.

When an icon is specified for the ToolBarItem it will work when the rootelement is a page.

The same setup with a UWP native App works without setting an icon and the root is a page.
Comment 1 Jimmy [MSFT] 2017-06-09 22:21:55 UTC
Thank you for filing this report! I am able to reproduce this issue with the GitHub project in the description. I tested with and 2.3.5-pre5 and it crashed on both. I am confirming this report so we can investigate further.