locked
WinRT c#/XAML - JIT Compiler encountered an internal limitation RRS feed

  • Question

  • I'm using an asynchronous JIT data retrieval pattern in a viewmodel in a c#/XAML WinRT project, and in one place (and only one, out of a half dozen or so) I get an InvalidProgramException, with the message "JIT Compiler encountered an internal limitation".  Here is the code (note, this is a property on a BindableBase-derived class):

            private bool _imageLoadingStarted = false;
    
            private WriteableBitmap _Image = null;
            public WriteableBitmap Image { 
                get {
                    if (_Image == null && !_imageLoadingStarted)
                    {
                        _imageLoadingStarted = true;
                        LoadImageAsync();
                    }
    
                    return _Image; 
                } 
                set { SetProperty(ref _Image, value); } }

    LoadImageAsync is a private async void () method.  It crashes with the InvalidProgramException on the LoadImageAsync() call. 

    I'm at a loss, because I use the exact same pattern with async methods with the same signature throughout my viewmodel classes for just-in-time instantiation.  I'm running VS2012 Express RC, version 11.0.50706.0 QRELRC on a Win8 release preview machine, if that matters.

    Anyone have a clue what's going on?


    • Edited by Beakin Saturday, September 1, 2012 5:08 PM
    Saturday, September 1, 2012 5:07 PM

All replies

  • Please test this on RTM and let us know if it reproduces.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, September 4, 2012 8:51 PM
    Moderator