UWP - 调试器附加到 .exe 但未配置 [英] UWP - A debugger is attached to .exe but not configured

查看:24
本文介绍了UWP - 调试器附加到 .exe 但未配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 Windows 应用商店应用 (UWP),但我在使用本机代码时遇到问题 - 我收到了这条消息.

I'm developing Windows Store App (UWP) and I have a problem with native code - I have this message.

此代码在第二次或第三次触发后抛出此异常.

This exception throw after this code fired for second or third time.

if(ProjectionManager.ProjectionDisplayAvailable)
{
    if(init != null)
    {
        init.ProjectionViewPageControl.StartViewInUse();
        await ProjectionManager.StopProjectingAsync(MainPage.SecondaryViewId, thisViewId);
        init.ProjectionViewPageControl.StopViewInUse();
        rootPage.ProjectionViewPageControl = null;
    }

    if(rootPage.ProjectionViewPageControl == null)
    {
        //First, create a new, blank view
        var thisDispatcher = Window.Current.Dispatcher;
        await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
        {
            rootPage.ProjectionViewPageControl = ViewLifetimeControl.CreateForCurrentView();                //ViewLifetimeControl is a wrapper to make sure the view is closed only when the app is done with it

            //Assemble some data necessary for the new page
            init = new ProjectionViewPageInitializationData();
            init.MainDispatcher = thisDispatcher;
            init.ProjectionViewPageControl = rootPage.ProjectionViewPageControl;
            init.MainViewId = thisViewId;
                                            //Note that the view will not become visible until "StartProjectingAsync" is called
            var rootFrame = new Frame();
            rootFrame.Navigate(typeof(ProjectionViewPage), init);
            Window.Current.Content = rootFrame;
            Window.Current.Activate();
        });
    }

    try
    {
        rootPage.ProjectionViewPageControl.StartViewInUse();    // Start/StopViewInUse are used to signal that the app is interacting with the view, so it shouldn't be closed yet, even if the user loses access to it
        await ProjectionManager.StartProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId);    // Show the view on a second display (if available) or on the primary display
        rootPage.ProjectionViewPageControl.StopViewInUse();
    }
    catch { }
}

ProjectionViewPage 打开,一切正常但我不知道出了什么问题.在不同的时间、不同的页面打开和关闭时间后抛出此异常.我不知道出了什么问题.

ProjectionViewPage opens, everything working But I don't know what's wrong. This exception thrown after different time, after different times of page opened and closed. I have no idea what's going wrong.

UPDProjectionViewPage 具有 MediaElement 控件时会出现问题.

UPD Problem occurs when ProjectionViewPage has MediaElement control.

推荐答案

您需要将调试器类型从 Managed Only(默认)更改为 Mixed.它不会修复您的异常,但至少您现在可以使用调试器跟踪它:)

You need to change the debugger type from Managed Only (default) to Mixed. It won't fix your exception, but at least you can trace it with the debugger now :)

这篇关于UWP - 调试器附加到 .exe 但未配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆