System.ExecutionEngineException on Windows 10 device
<p>I am developing a Windows Phone 8.1 app. It works fine on WP 8 and WP 8.1 devices, but on the device with Windows 10 it throws</p>

<p><code>ExecutionEngineException was unhandled. An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.</code></p>

<p>in various sections in both "Debug" and "Release" without any data about what went wrong. There are some places, where the exception is always thrown and some, where it's thrown from time to time. Example code below throws the exception - it is basically a method to switch between tabs, which are StackPanels when the button (Grid with Image) is tapped:</p>

<pre><code>private void Grid_Tapped(object sender, TappedRoutedEventArgs e)
{
    if(!isMapVisible)
    {
        hideSection();
        map_wrapper.Visibility = Windows.UI.Xaml.Visibility.Visible;
        map_button.Background = new SolidColorBrush(ColorHelper.FromArgb(0xFF, 40, 110, 73));
        map_icon.Source = new BitmapImage(new Uri(FileHelper.getIconPath("tu_2.png")));
        isMapVisible = true;
    }
}

private void hideSection()
{
    if(isMapVisible)
    {
        map_button.Background = new SolidColorBrush(ColorHelper.FromArgb(0xFF, 238, 238, 238));
        map_icon.Source = new BitmapImage(new Uri(FileHelper.getIconPath("tu.png")));
        isMapVisible = false;
        map_wrapper.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
    }
    else if(isPhotoVisible)
    {
        photo_button.Background = new SolidColorBrush(ColorHelper.FromArgb(0xFF, 238, 238, 238));
        photo_icon.Source = new BitmapImage(new Uri(FileHelper.getIconPath("photo_green.png")));
        isPhotoVisible = false;
        image_wrapper.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
    }
    else if(isListVisible)
    {
        list_button.Background = new SolidColorBrush(ColorHelper.FromArgb(0xFF, 238, 238, 238));
        list_icon.Source = new BitmapImage(new Uri(FileHelper.getIconPath("!2.png")));
        isListVisible = false;
        news_wrapper.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
    }
}
</code></pre>