Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] UWP application cannot run in release mode in Xamarin.Forms 4.8 #11736

Closed
holecekp opened this issue Aug 10, 2020 · 2 comments
Closed

[Bug] UWP application cannot run in release mode in Xamarin.Forms 4.8 #11736

holecekp opened this issue Aug 10, 2020 · 2 comments
Labels
4.8.0 regression on 4.8.0 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. i/regression in-progress This issue has an associated pull request that may resolve it! p/UWP t/bug 🐛
Milestone

Comments

@holecekp
Copy link

holecekp commented Aug 10, 2020

Description

UWP applications with Shell cannot run in the release mode. It crashes immediately after start. When I downgrade to 4.7.0.1239, it runs also in the release mode.

My application works fine in debug mode. When I switch to release mode and run it using Ctrl+F5, the following error is displayed:
UWP_release_mode_crash

When I run it using F5, a more details are shown. It seems that the crash is in the OnLaunched method in the App.xml.cs in the UWP project. The error message is "Unhandled exception at 0x01D5D83E (SharedLibrary.dll) in MyApp.UWP.exe: 0x00001007.":

UWP_release_mode_crash_F5

Things that I have tried and that do not help:

  • restart
  • clean solution + delete bin and obj folders
  • uninstall manually my app

If I downgrade XF back to 4.7.0.1239, the app works fine in the release mode. The bug is in the Shell. If I set the MainPage to a ContentPage instead of the Shell, the app runs also in release mode in XF 4.8.

This bug is very nasty because everything seems to be all right during development. I have already added several new features that use gradient brushes from XF 4.8. Only when I prepared a new version and tried to publish it, I have released that it is completely broken.

Steps to Reproduce

I have prepared a repro project.
UwpReleaseCrash.zip
Try to launch it in debug mode and it should work. Now try it in release mode. It crashes immediately.

The repro project does not contain anything special. It is basically a new blank Xamarin.Form project created in Visual Studio where I have just added Shell and upgraded all Nugets.

Expected behavior

The UWP applications with Shell should work in both debug and release mode.

Actual behavior

The UWP applications with Shell works only in debug mode. It crashes immediately in release mode.

Basic Information

  • Version with issue: 4.8.1269
  • Last known good version: 4.7.0.1239
  • IDE: VS 2019 (16.6.5)
  • Platform Target Frameworks:
    • UWP: TargetVersion 1903
  • Nuget Packages:
    Xamarin.Forms (4.7.0.1239)
    Xamarin.Essentials (1.5.3.2)
    Microsoft.NETCore.UniversalWindowsPlatform (6.2.10)

Workaround

No workaround. The only way how to make it work again is to revert all your recent commits that uses features from Xamarin.Forms 4.8 and downgrade back to Xamarin.Forms 4.7 :-(.

@holecekp holecekp added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 10, 2020
@rmarinho rmarinho added i/regression 4.8.0 regression on 4.8.0 p/UWP blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. and removed s/unverified New report that has yet to be verified labels Aug 11, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 12, 2020
@samhouts samhouts added this to the 4.8.0 milestone Aug 13, 2020
@a-einstein
Copy link

a-einstein commented Aug 17, 2020

I hope this is related to my problem, that seems similar.
And that it also solves my problem.

Can anyone comment on that?

I use Xamarin.Forms 4.8.0.1269.

I can run and install the DEBUG build of the UWP-version of my client, for both x86 and x64.
But when I try to run any RELEASE build it crashes, in slightly different ways depending on the architecture.

In both cases it basically crashes in Application on:
MainPage = new Shell();

The exception is:
Unhandled exception at 0x7BC8D83E (SharedLibrary.dll) in My.exe: 0x00001007. occurred

The stack for x86 is:
System.Private.CoreLib.dll!Interop.mincore.RaiseFailFastException(uint faultCode, System.IntPtr pExAddress, System.IntPtr pExContext) Line 88 C# System.Private.CoreLib.dll!System.RuntimeExceptionHelpers.FailFast(string message, System.Exception exception, System.RuntimeExceptionHelpers.RhFailFastReason reason, System.IntPtr pExAddress, System.IntPtr pExContext) Line 236 C# System.Private.CoreLib.dll!System.RuntimeExceptionHelpers.RuntimeFailFast(System.RuntimeExceptionHelpers.RhFailFastReason reason, System.Exception exception, System.IntPtr pExAddress, System.IntPtr pExContext) Line 193 C# [External Code] RCS.PortableShopp.UWP.McgInterop.dll!__Interop.ComCallHelpers.Call(System.__ComObject __this, System.RuntimeTypeHandle __typeHnd, int __targetIndex, System.Type__Impl.UnsafeType arg0, void* arg1, void* arg2) C# RCS.PortableShopp.UWP.McgInterop.dll!Windows.UI.Xaml.Controls.IFrame__Impl.Stubs.Navigate(System.__ComObject __this, System.Type sourcePageType, object parameter) C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellSectionRenderer.NavigateToContent(Xamarin.Forms.ShellNavigationSource source, Xamarin.Forms.ShellContent shellContent, Xamarin.Forms.Page page, bool animate) Line 154 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellSectionRenderer.NavigateToShellSection(Xamarin.Forms.ShellNavigationSource source, Xamarin.Forms.ShellSection section, Xamarin.Forms.Page page, bool animate) Line 92 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellItemRenderer.SwitchSection(Xamarin.Forms.ShellNavigationSource source, Xamarin.Forms.ShellSection section, Xamarin.Forms.Page page, bool animate) Line 323 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellItemRenderer.ShellSection.set(Xamarin.Forms.ShellSection value) Line 239 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellItemRenderer.NavigateToShellItem(Xamarin.Forms.ShellItem newItem, bool animate) Line 108 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellRenderer.OnElementSet(Xamarin.Forms.Shell shell) Line 244 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ShellRenderer.SetElement(Xamarin.Forms.VisualElement element) Line 153 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) Line 48 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.VisualElementExtensions.GetOrCreateRenderer(Xamarin.Forms.VisualElement self) Line 17 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.Platform.AddPage(Xamarin.Forms.Page page) Line 403 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.Platform.SetCurrent(Xamarin.Forms.Page newPage, bool popping, bool modal, System.Action completedCallback) Line 361 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.Platform.SetPage(Xamarin.Forms.Page newRoot) Line 132 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.WindowsBasePage.RegisterWindow(Xamarin.Forms.Page page) Line 45 C# Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.WindowsBasePage.OnApplicationPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) Line 54 C# [External Code] Xamarin.Forms.Core.dll!Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName) Line 229 C# Xamarin.Forms.Core.dll!Xamarin.Forms.Element.OnPropertyChanged(string propertyName) Line 354 C# Xamarin.Forms.Core.dll!Xamarin.Forms.Application.MainPage.set(Xamarin.Forms.Page value) Line 93 C#

samhouts pushed a commit that referenced this issue Aug 24, 2020
…avigation (#11766)

* Convert Shell Page to Xaml page

* - Add Shell store tests

* - disable appx for pages and copy from correct ui test folder

* - fix yaml checks

* - force UseDotNetNativeToolchain false

fixes #11736
@samhouts
Copy link
Member

closed by #11766

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.8.0 regression on 4.8.0 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. i/regression in-progress This issue has an associated pull request that may resolve it! p/UWP t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants