locked
MissingRuntimeArtifactException in Xamarin.Forms RRS feed

  • Question

  • Dear Xavier,

    i also experience the same problems. The app runs fine, till i enable the ".NET Native Toolchain". It's an Xamarin.Forms App for UWP.

    After several problems i finally get these exceptions, only when .net native toolchain is enabled.

    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 http://go.microsoft.com/fwlink/?LinkID=616868'

    I recognized the link in the exception and i tried following its instructions, so i changed the Default.rd.xml to this:

    <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
      <Application>
        <!--
          An Assembly element with Name="*Application*" applies to all assemblies in
          the application package. The asterisks are not wildcards.
        -->
        <Assembly Name="*Application*" Dynamic="Required All" />
        
        
        <!-- Add your application specific runtime directives here. -->
    
        <Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatformServices" Serialize="Required All" />
        <Type Name="Xamarin.Forms.Platform.UWP.Platform">
          <MethodInstantiation Name="OnPageAlert" Arguments="System.Object, Xamarin.Forms.Internals.AlertArguments" Dynamic="Required" />
        </Type>
        <Type Name="System.EventHandler" Dynamic="Required All" />
    
      </Application>
    </Directives>

    but it does not change the behavior at all.
    Any hint for that?

    cheers,
    Chris



    Sent from my Windows PC :)

    Monday, February 19, 2018 1:37 PM

All replies

  • Hi Chris,

    For help with Xamarin please post in the Xamarin forums on http://forums.xamarin.com and check the Issues at http://github.com/xamarin/xamarin.forms .

    As a general principle, please post new questions in their own threads rather than adding to existing threads on different problems (even though the thread was on the same general subject of .Net Native, the specific topic was unrelated to your question). Adding new questions to existing threads can cause your question to be lost.

    If this is a runtime issue then you may also find useful information by debugging to see where this is thrown and what exactly the code is doing there. See https://docs.microsoft.com/en-us/dotnet/framework/net-native/getting-started-with-net-native#Step4 for hints on addressing such exceptions in general. Folks in the Xamarin forums may have more specific advice for Xamarin.Forms.

    Monday, February 19, 2018 10:28 PM