UWP - Immediate crash in release mode

PhilipOGormanPhilipOGorman USMember ✭✭✭

I have a forms solution, it runs fine in debug but crashes immediately in release mode, it doesn’t even get to my MainPage constructor:

    Unhandled exception at 0x54D62408 (Windows.UI.Xaml.dll) in SmartCart.UWP.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0D6594E8, 0x00000003).
    Unhandled exception at 0x76341104 (combase.dll) in SmartCart.UWP.exe: 0xC0000602:  A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately.
    STATUS_STACK_BUFFER_OVERRUN encountered
    The program '[11592] SmartCart.UWP.exe' has exited with code -1073740791 (0xc0000409).

When I build everything in release except for my UWP project the project will run.

Is this an issue with forms? Has anyone build and run UWP Forms in release mode?

Best Answers

Answers

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    My issue is very similar to this:
    http://stackoverflow.com/questions/33106297/application-internal-exception-in-windows-ui-xaml-dll#comment55953981_33106297

    From what I understand, compiling with release mode enables the Compile with .NET Native tool chain option.
    The frustration is that I cannot even step in to my code- the crash a happen as the libraries are begin loaded.

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    I see the same exact crash in the xamarin sample app:
    https://github.com/jamesmontemagno/MyWeather.Forms

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    @JamesMontemagno any idea what might be happening here?
    It looks like Forms is not working in release mode for UWP. Windows store will only accept app is built in release mode.
    Could you try to build your sample in release mode an see if you have the same issue?

    Thanks!

  • WayneGuWayneGu CNMember ✭✭

    I have the similar problem.
    App crashes as soon as it starts in release mode.

  • ClayMartinClayMartin USUniversity ✭✭

    I'm having the same problem. @JamesMontemagno can you compile and run your app using the .net native toolchain? Has anyone been able to do this?

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    Here is the rely from support:

    "Thank you very much for your patience with this. UWP is currently a preview product offered by Xamarin. I'll be happy to work with you on getting an issue filed against this, but unfortunately, I won't be able to guarantee anything due to the preview status."

    I have ask my Customer Success Manager what the release schedule is, but I have heard anything back yet. So far I can only work with debug

  • cleardemoncleardemon USMember

    Seems this is still an issue, and I suppose the workaround for now is to just use Debug builds.

    I was able to catch a stack trace (via Insights), if that helps anyone:

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    Raw
       at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
       at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
       at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
       at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)
       at Xamarin.Forms.Forms.Init(IActivatedEventArgs launchActivatedEventArgs, IEnumerable`1 rendererAssemblies)
       at Syncode.Swapped.Platform.Forms.WinUniversal.App.<OnLaunched>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
       at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()
    
  • BastiBrauningBastiBrauning USMember

    I have the same issues in release mode.

    Seems to be related to .Net Native compilation and some unsupported calls to System.Reflection (from Xamarin.Forms side).

  • cleardemoncleardemon USMember

    Damn, this is a tough one. After some poking around with dotPeek, the assemblies you need to tell Forms about are ones that declare either a renderer, cell or ImageSource handler (e.g. the ExportRenderer attribute).

    That's all well and good for assemblies that I either own or reference, but what if those 3rd party references reference other 3rd party assembles, that I don't explicitly use in my app? Becomes a nightmare to keep track of all that!

    Annoyingly, this problem goes away if you turn off Native .NET compilation... but, I don't seem to be able to produce .appx packages when that is the case...

    All I'm trying to do is deploy the app to the Windows Store (in beta capacity, not even public release). Has anyone managed to do that yet?

  • cleardemoncleardemon USMember

    Just updating here, while I haven't been able to submit to the Store yet, the best solution so far I've found to get a release build is to do the following:

    • Unset UapAppxPackageBuildMode if it is set in MyApp.csproj.user (if you've followed these instructions).
    • Disable Native .NET under the project's Build settings in Release configuration
    • Use Project->Store->Create App Packages and build Release versions for x86/ARM (not x64)

    This will produce packages that can then be sideloaded on a target machine. While it doesn't produce an .appxupload archive that the Store expects, this does at least allow to distribute outside of the Store, which is good enough for testing.

    However, producing an .appxupload from these packages should be possible, I just haven't figured that out yet. Details about doing so could be gleaned from here.

  • TimWilsonTimWilson USMember

    @cleardemon thanks for the info. I am currently working through this issue as well. Have you considered the performance implications of turning off compiling to .NET native?

    https://msdn.microsoft.com/en-us/library/dn584397(v=vs.110).aspx

  • TimWilsonTimWilson USMember

    I was able to resolve our issue thanks to this stack overflow post.

    All I had to do was add the following directives file (Add < New Item < Directives file):

    <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
      <Application>
        <Type Name="System.EventHandler" Dynamic="Required All" />
      </Application>
    </Directives>
    
  • huangjinshehuangjinshe USMember ✭✭✭

    @cleardemon said:
    Just updating here, while I haven't been able to submit to the Store yet, the best solution so far I've found to get a release build is to do the following:

    • Unset UapAppxPackageBuildMode if it is set in MyApp.csproj.user (if you've followed these instructions).
    • Disable Native .NET under the project's Build settings in Release configuration
    • Use Project->Store->Create App Packages and build Release versions for x86/ARM (not x64)

    This will produce packages that can then be sideloaded on a target machine. While it doesn't produce an .appxupload archive that the Store expects, this does at least allow to distribute outside of the Store, which is good enough for testing.

    However, producing an .appxupload from these packages should be possible, I just haven't figured that out yet. Details about doing so could be gleaned from here.

    Did you got a solution for this now?

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    @huangjinshe not yet - I haven't tried in a while. My customer is still running the debug build

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    What I found was that the release build just doesn't even run in 'Local Machine'. It was complaining about some symbols .pdb file. But unchecking 'Compile with .NET Native tool chain' and selecting the option 'Disable just my code and continue' when asked made my app to run in local machine though I have not yet built the packages for store submission.

    I didn't unset the UseAppxPackageBuildMode as suggested by @cleardemon . Probably it worked for me as I was not building package for store submission.

    It didn't matter whether I created the directives xml file or not as suggested by @TimWilson .

  • TimWilsonTimWilson USMember

    Whenever I run the debugger (in either release or debug mode) some exceptions are thrown about missing assemblies, however if I ignore them, the app still seems to run fine.

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    @TomSoderling we are still running in debug, we haven't tried release in a long time, I was hoping xamarin would do something about this . For the dependent assemblies how did you know what to register? was it simply the dlls that are copied to the bin folder?

  • TomSoderlingTomSoderling USUniversity ✭✭✭
    edited October 2016

    We're only passing in 4 assemblies to the Forms.Init method in our app:

    • 2 for MR.Gestures, which they told us to do here
    • 1 for NControl.UWP. The control wasn't showing up at all in Release/.NET Native builds until I added it.
    • 1 for the Circle Image Control plugin. Similar reasoning, the images were show up as square, until I added it.

    // For .NET Native compilation, you have to tell Xamarin.Forms which assemblies it should scan for custom controls and renderers var otherAssemblies = new[] { typeof(MR.Gestures.ContentPage).GetTypeInfo().Assembly, typeof(MR.Gestures.UWP.Renderers.PageRenderer).GetTypeInfo().Assembly, typeof(NControl.UWP.NControlViewRenderer).GetTypeInfo().Assembly, typeof(ImageCircle.Forms.Plugin.UWP.ImageCircleRenderer).GetTypeInfo().Assembly }; Xamarin.Forms.Forms.Init(e, otherAssemblies);

    The Xamarin doc says "third party control libraries, or your application itself is split into multiple PCLs", so each of ours would fall under that first category. I noticed that the parameter name for the UWP overload is "rendererAssemblies", so I'm guessing it needs to know about visual elements?
    However, you'll notice that James seemed to add everything and the kitchen sink in his Evolve app. Not sure if all that is needed.

    In our case, I wasn't getting any exceptions, the controls just weren't showing up.

  • JohnHardmanJohnHardman GBUniversity mod
    edited October 2016

    Does anybody know where the limit is (i.e. what the decision process is) on what to include in the list of assemblies for Xamarin.Forms.Forms.Init for UWP?

    Looking at @JamesMontemagno 's code from Evolve, there are the usual suspects, including one starting System.

    I've currently got 59 assemblies in the list I pass to Xamarin.Forms.Forms.Init (it's a complex app). Even so, if I compare that list against what Visual Studio tells me is actually in use at runtime in a debug build on Windows 10 desktop, there are plenty more actually in use - the lists below numbered 1-3 are all the assemblies in use but that I have not yet listed. I've divided them into three groups below, with a comment saying whether I think they should be included in the list for Forms.Init . Do those comments seem reasonable?

    (1) Probably want adding?
    Microsoft.WindowsAzure.Mobile.SQLiteStore.dll
    SQLitePCL.Ext.dll

    (2) Probably don't want adding?
    Microsoft.Win32.Primitives.dll
    mscorlib.ni.dll
    WinMetadata\Windows.winmd
    Xamarin.Forms.Platform.dll

    (3) Probably don't want adding?
    System.AppContext.dll
    System.Buffers.dll
    System.Collections.Concurrent.dll
    System.Collections.dll
    System.Collections.Immutable.dll
    System.Collections.NonGeneric.dll
    System.Collections.Specialized.dll
    System.ComponentModel.Annotations.dll
    System.ComponentModel.DataAnnotations.dll
    System.ComponentModel.dll
    System.ComponentModel.EventBasedAsync.dll
    System.Core.dll
    System.Data.Common.dll
    System.Diagnostics.Contracts.dll
    System.Diagnostics.Debug.dll
    System.Diagnostics.DiagnosticSource.dll
    System.Diagnostics.StackTrace.dll
    System.Diagnostics.Tools.dll
    System.Diagnostics.Tracing.dll
    System.dll
    System.Dynamic.Runtime.dll
    System.Globalization.Calendars.dll
    System.Globalization.dll
    System.Globalization.Extensions.dll
    System.IO.Compression.dll
    System.IO.Compression.ZipFile.dll
    System.IO.dll
    System.IO.FileSystem.dll
    System.IO.FileSystem.Primitives.dll
    System.IO.IsolatedStorage.dll
    System.IO.UnmanagedMemoryStream.dll
    System.Linq.dll
    System.Linq.Expressions.dll
    System.Linq.Parallel.dll
    System.Linq.Queryable.dll
    System.Net.dll
    System.Net.Http.Extensions.dll
    System.Net.Http.Primitives.dll
    System.Net.Http.Rtc.dll
    System.Net.NameResolution.dll
    System.Net.NetworkInformation.dll
    System.Net.Primitives.dll
    System.Net.Requests.dll
    System.Net.Sockets.dll
    System.Net.WebHeaderCollection.dll
    System.Net.WebSockets.Client.dll
    System.Net.WebSockets.dll
    System.Numerics.dll
    System.Numerics.Vectors.dll
    System.Numerics.Vectors.WindowsRuntime.dll
    System.ObjectModel.dll
    System.Private.DataContractSerialization.dll
    System.Private.ServiceModel.dll
    System.Private.Uri.dll
    System.Reflection.Context.dll
    System.Reflection.DispatchProxy.dll
    System.Reflection.dll
    System.Reflection.Emit.dll
    System.Reflection.Emit.ILGeneration.dll
    System.Reflection.Emit.Lightweight.dll
    System.Reflection.Extensions.dll
    System.Reflection.Metadata.dll
    System.Reflection.Primitives.dll
    System.Reflection.TypeExtensions.dll
    System.Resources.ResourceManager.dll
    System.Runtime.dll
    System.Runtime.Extensions.dll
    System.Runtime.Handles.dll
    System.Runtime.InteropServices.dll
    System.Runtime.InteropServices.WindowsRuntime.dll
    System.Runtime.Numerics.dll
    System.Runtime.Serialization.dll
    System.Runtime.Serialization.Json.dll
    System.Runtime.Serialization.Primitives.dll
    System.Runtime.Serialization.Xml.dll
    System.Runtime.WindowsRuntime.dll
    System.Runtime.WindowsRuntime.UI.Xaml.dll
    System.Security.Claims.dll
    System.Security.Cryptography.Algorithms.dll
    System.Security.Cryptography.Cng.dll
    System.Security.Cryptography.Encoding.dll
    System.Security.Cryptography.Primitives.dll
    System.Security.Cryptography.X509Certificates.dll
    System.Security.Principal.dll
    System.ServiceModel.dll
    System.ServiceModel.Duplex.dll
    System.ServiceModel.Http.dll
    System.ServiceModel.NetTcp.dll
    System.ServiceModel.Primitives.dll
    System.ServiceModel.Security.dll
    System.ServiceModel.Web.dll
    System.Text.Encoding.CodePages.dll
    System.Text.Encoding.dll
    System.Text.Encoding.Extensions.dll
    System.Text.RegularExpressions.dll
    System.Threading.dll
    System.Threading.Overlapped.dll
    System.Threading.Tasks.Dataflow.dll
    System.Threading.Tasks.dll
    System.Threading.Tasks.Extensions.dll
    System.Threading.Tasks.Parallel.dll
    System.Threading.Timer.dll
    System.Windows.dll
    System.Xml.dll
    System.Xml.Linq.dll
    System.Xml.ReaderWriter.dll
    System.Xml.Serialization.dll
    System.Xml.XDocument.dll
    System.Xml.XmlDocument.dll
    System.Xml.XmlSerializer.dll

    For info, excluding the ones that are within my own code, the following is the list of types (not assemblies) that I am currently including (I expect this list to grow as I add some more back-end stuff):

    Badge.Plugin.CrossBadge
    Badge.Plugin.Abstractions.IBadge
    Microsoft.ApplicationInsights.TelemetryClient
    Microsoft.ApplicationInsights.WindowsAppInitializer
    Microsoft.ApplicationInsights.Channel.PersistenceChannel
    Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
    Microsoft.Graphics.Canvas.CanvasActiveLayer
    Microsoft.HockeyApp.HockeyClient
    Microsoft.HockeyApp.HockeyClientExtensionsUwp
    Microsoft.WindowsAzure.MobileServices.CreatedAtAttribute
    Microsoft.WindowsAzure.MobileServices.Push
    MR.Gestures.ContentPage
    MR.Gestures.UWP.Renderers.PageRenderer
    Newtonsoft.Json.ConstructorHandling
    PCLCrypto.AsymmetricAlgorithm
    PInvoke.BCrypt
    PInvoke.Kernel32
    PInvoke.NCrypt
    PInvoke.ApiSets
    Plugin.Calendars.CrossCalendars
    Plugin.Calendars.Abstractions.Calendar
    Plugin.Connectivity.CrossConnectivity
    Plugin.Connectivity.Abstractions.BaseConnectivity
    Plugin.Contacts.CrossContacts
    Plugin.Contacts.Abstractions.Account
    Plugin.DeviceInfo.CrossDeviceInfo
    Plugin.DeviceInfo.Abstractions.IDeviceInfo
    Plugin.Geolocator.CrossGeolocator
    Plugin.Geolocator.Abstractions.GeolocationError
    Plugin.LocalNotifications.CrossLocalNotifications
    Plugin.LocalNotifications.Abstractions.ILocalNotifications
    Plugin.Permissions.CrossPermissions
    Plugin.Permissions.Abstractions.IPermissions
    Plugin.Settings.CrossSettings
    Plugin.Settings.Abstractions.ISettings
    Plugin.Share.CrossShare
    Plugin.Share.Abstractions.BrowserOptions
    Plugin.Vibrate.CrossVibrate
    Plugin.Vibrate.Abstractions.IVibrate
    SQLite.Net.BaseTableQuery
    SQLite.Net.Platform.WinRT.ReflectionServiceWinRT
    SQLitePCL.AggregateFinal
    System.Net.Http.HttpClient
    Plugin.Toasts.IToastNotificator
    Plugin.Toasts.DefaultToastLayoutRenderer
    Validation.Assumes
    Core.Decimal
    Xamarin.Forms.AbsoluteLayout
    Xamarin.Forms.Forms
    Xamarin.Forms.Xaml.ArrayExtension
    Xamarin.Insights
    Xamarin.Forms.Platform.UWP.Platform
    Microsoft.VisualBasic.CallType

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    @JamesMontemagno or anyone at Xamarim, can you answer @JohnHardman question. How do we know what assemblies to include/register? Is there a systematic way of doing this?

  • TomSoderlingTomSoderling USUniversity ✭✭✭

    @JohnHardman - Is the app crashing? I don't understand what you're trying to achieve.

    From the Xamarin Doc, the decision process is: "If your UWP app is referencing multiple assemblies (for example third party control libraries, or your application itself is split into multiple PCLs), Xamarin.Forms may be unable to load objects from those assemblies (such as custom renderers)" - is that what's happening? Are there objects the app is unable to load? Is it crashing? Are visual elements that use a custom renderer not appearing on screen?

  • JohnHardmanJohnHardman GBUniversity mod

    @TomSoderling - You said that you only pass in 4 assemblies. You also said that "James seemed to add everything and the kitchen sink in his Evolve app". James is pretty central to all that happens at Xamarin, so is there a reason he threw in the kitchen sink or was it unnecessary? You said that you are "Not sure". I'm not either. Hence trying to get clarification of what is necessary, to preempt the possibility of a run-time problem in a release build when one of the more obscure code paths in my app is executed.

  • TomSoderlingTomSoderling USUniversity ✭✭✭

    @JohnHardman Yep, makes sense. I'd also like to know that.
    I was curious if you were experiencing this immediate crash issue Philip or others mentioned

  • JohnHardmanJohnHardman GBUniversity mod

    @TomSoderling - I haven't done a release build for a while, so no. However, I might give it a go in the coming days :-)

  • TomSoderlingTomSoderling USUniversity ✭✭✭

    @JohnHardman from James: "Mostly you just need third party ones. I just did them all lol cause I wasn’t sure to be honest"

  • oatsodaoatsoda USMember ✭✭

    @cleardemon said:
    Seems this is still an issue, and I suppose the workaround for now is to just use Debug builds.

    I was able to catch a stack trace (via Insights), if that helps anyone:

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    Raw
       at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
       at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
       at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
       at Xamarin.Forms.Registrar.RegisterAll(Type[] attrTypes)
       at Xamarin.Forms.Forms.Init(IActivatedEventArgs launchActivatedEventArgs, IEnumerable`1 rendererAssemblies)
       at Syncode.Swapped.Platform.Forms.WinUniversal.App.<OnLaunched>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
       at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()
    

    @cleardemon Did you solve your " Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified." issue?

    I am getting this exact same issue and I have tried -

    • Ensuring VS is up to date (14.0.25431.01)
    • Adding all third party assemblies into the UWP Init method
    • Ensuring Microsoft.NETCore.UniversalWindowsPlatform NuGet package is up to date (5.2.2)

    I'm just wondering if the fixes suggested in this thread did solve your problems?

  • MatthewRMatthewR USMember ✭✭

    Is there any news on this issue? I've updated VS, added all third party assemblies, and updated the Microsoft.NETCore.UniversalWindowsPlatform to latest (5.4.0)

    Turning off "Compile with .NET Native tool chain" makes the application not throw an exception on startup anymore but I'd rather not turn that off.

    Here is a link to bugzilla for the issue https://bugzilla.xamarin.com/show_bug.cgi?id=37658

  • JohnHardmanJohnHardman GBUniversity mod

    @EZHart @JamesMontemagno @DavidOrtinau - any clarification on this, or a process that can be followed that reliably provides the minimum list of assemblies to add to the Init call?

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    @JohnHardman said:
    @EZHart @JamesMontemagno @DavidOrtinau - any clarification on this, or a process that can be followed that reliably provides the minimum list of assemblies to add to the Init call?

    +1, we have no systematic of knowing what assemblies to include.

  • marciosouzajuniormarciosouzajunior BRMember ✭✭
    edited September 2017

    My project uses IGrouping interface and caused this issue. Solved adding this to Default.rd.xml:

    <Namespace Name="System.Linq" Dynamic="Required All" />

  • PaulDistonPaulDiston USUniversity ✭✭✭✭

    I would really like to know how to determine which assemblies to include.

    By including assemblies have other problems been fixed with UWP apps, for example, everything seems to work fine in Debug but as soon as you try Release with Compile with .NET Native tool chain checked things go wrong such as SQLite database inserts not occurring and the app maybe hanging?

  • JohnHardmanJohnHardman GBUniversity mod

    @DavidOrtinau - Is there any update on providing a tool that can identify the assemblies that need to be included in the Init call for UWP?

  • I'm interessted in that tool also, because I'm currently experiencing:

    System.Reflection.MissingRuntimeArtifactException: 'Cannot retrieve a MethodInfo for this delegate because the method it targeted (Void Xamarin.Forms.Platform.UWP.Platform.OnPageAlert(Object, AlertArguments)) was not enabled for metadata using the Dynamic attribute. For more information, please visit htt*p://go.microsoft.com/fwlink/?LinkID=616868'

    I don't know how to avoid these. I already added this

    <Assembly Name="*Application*" Dynamic="Required All" />
    <Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatformServices" Serialize="Required All" />
    <Type Name="Xamarin.Forms.Platform.UWP.Platform" Serialize="Required All" Dynamic="Required All"/>
    <Type Name="Xamarin.Forms.Platform.UWP.Platform">
        <MethodInstantiation Name="OnPageAlert" Arguments="System.Object" Dynamic="Required" />
    </Type>
    <Type Name="System.EventHandler" Dynamic="Required All" />
    

    to the Default.rd.xml of the UWP project, but with no result.

  • LuisLixLuisLix Member ✭✭

    Use Xaml Compilations: Add Xaml compilation tag for all xaml.cs files

    [XamlCompilation(XamlCompilationOptions.Compile)]

    even App.xaml.cs

  • SmartmanAppsSmartmanApps AUMember ✭✭✭
    edited May 15

    @TomSoderling said:

    • Be sure to add dependent assemblies to your Xamarin.Forms.Forms.Init call. There is a special overload for UWP. Instructions here, example from the Evolve app here. I had to do this for ALL custom renderers that live in 3rd part libraries we're using (Image Circle Control plugin, NControl)

    We've managed to release our app to the Windows Store, so I want to encourage you that it can be done. We've received confirmation from Xamarin that UWP support for Xamarin.Forms is out of Public Preview and is in Stable Release.

    I've run into this in VS2019 (runs fine in VS, but when I make a release package it installs fine but then crashes at launch), so still not fixed. The quoted links are no longer valid, and is the only thing I haven't tried out of everything in this thread. ATM I'm still testing, but the ultimate aim is to get in the store, so I need this resolved. :-(

    Correction: Having resolved myself to having to settle for debug builds for now, even THAT crashes, so, so far, I haven't found a single successful way to install a UWP package. :-(

Sign In or Register to comment.