Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

IL2CP With WINMD_SUPPORT

Discussion in 'Windows' started by ClaytonOne, May 3, 2017.

  1. ClaytonOne

    ClaytonOne

    Joined:
    Sep 5, 2015
    Posts:
    89
    Hi, I'm trying to get a simple uwp message dialog working with IL2CPP.

    I've chosen IL2CPP as scripting backend and .NET 4.6 as the api compat level.

    Then I simply have the following script which is called by a button press, the project compiles and runs correctly but when I press the button the following error comes up.

    "NotSupportedException: ....... IL2CPP does not yet support calling this projected method"

    Below is my script

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. #if ENABLE_WINMD_SUPPORT
    4. using System;
    5. using System.Collections.Generic;
    6. using Windows.UI.Core;
    7. using Windows.UI.Popups;
    8. #endif
    9.  
    10.  
    11. public class TestScript : MonoBehaviour
    12. {
    13.     public void DoSomething()
    14.     {
    15. #if ENABLE_WINMD_SUPPORT
    16.         var messageDialog = new MessageDialog("A Message", "A Title");
    17.         messageDialog.Commands.Add(new UICommand("Ok"));
    18.         messageDialog.DefaultCommandIndex = 0;
    19.         messageDialog.CancelCommandIndex = 0;
    20.         messageDialog.ShowAsync();
    21. #endif
    22.     }
    23. }
    Thanks
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Can we get a bug report on this?
     
  3. ClaytonOne

    ClaytonOne

    Joined:
    Sep 5, 2015
    Posts:
    89
    Might be a stupid question but where do I file a bug report?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507