简体   繁体   English

UWP应用发布版本挂在初始屏幕上吗?

[英]UWP app release version hangs on splash screen?

Debug versions (86, 64, ARM) all work fine, release versions build fine, but when they run all that happens is my app window opens and remains blank (white background). 调试版本(86、64,ARM)都可以正常工作,发布版本可以正常运行,但是当它们运行时,我的应用程序窗口打开并保持空白(白色背景)。 The only errors I see in the output are a whole bunch of: 我在输出中看到的唯一错误是一堆错误:

 ...PDB file was not present when IL code was compiled to native.

I'm not sure if the missing .pdb files are the culprit - pretty sure they're not, cause they're just for debugging purposes right? 我不确定丢失的.pdb文件是否是罪魁祸首-可以肯定的是,不是,因为它们只是出于调试目的,对吧? Anyways, this is the first UWP app I have tried to get ready for the Windows Store, and not completely sure if I have to do anything special like sign it to test release versions on my own computer? 无论如何,这是我尝试为Windows应用商店准备的第一个UWP应用,并且不确定是否需要做一些特别的事情,例如在我自己的计算机上进行签名以测试发行版本?

Edit 1: Thank you @Alan for your suggestions, manually uninstalling the app sometimes gets me past the blank window to load the app bar, but then I am getting these errors when it doesn't hang on the splash screen: 编辑1:谢谢@Alan的建议,手动卸载应用程序有时使我越过空白窗口来加载应用程序栏,但是当它没有挂在初始屏幕上时,我得到了这些错误:

Debugger Error 1 , Debugger Error 2 调试器错误1调试器错误2

I have done nothing special to the splash screen, loaded all my visual assets using the built in tools in manifest, and have not modified App.xaml.cs from its default. 我没有对启动屏幕做任何特别的事情,使用清单中的内置工具加载了所有视觉资源,并且没有修改App.xaml.cs的默认设置。 Here is my Mainpage.cs: 这是我的Mainpage.cs:

 using Sublist.Classes;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
 using Windows.UI.Xaml.Navigation;

 namespace Sublist
 {

public sealed partial class MainPage : Page
{
    const string TAG = "MainPage: ";

    // for loading and saving user data and settings
    public static DataHandler dataHandler;

    public static MasterList<Entry> masterList;
    //public static int listViewSelectedIndex = -1;

    public MainPage()
    {
        this.InitializeComponent();

        dataHandler = new DataHandler(this);
        masterList = new MasterList<Entry>();

        // load user data
        if (dataHandler.userDataList != null)
            masterList = dataHandler.userDataList;

        masterList.UpdateListView(this);
    }

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        dataHandler.LoadUserSettings();
    }


    private void AppBarAdd_Click(object sender, RoutedEventArgs e)
    {
        masterList.AddRow(this);
    }

    private void AppBarRemove_Click(object sender, RoutedEventArgs e)
    {
        if (!(mainListView.SelectedIndex < 0))
        {
            masterList.RemoveRow(this);
        }
    }

    private void AppBarMoveDown_Click(object sender, RoutedEventArgs e)
    {

    }

    private void AppBarMoveUp_Click(object sender, RoutedEventArgs e)
    {

    }

    private void AppBarIndent_Click(object sender, RoutedEventArgs e)
    {
        // indent the row control if currently selected index is a list view item
        if (-1 < mainListView.SelectedIndex && mainListView.SelectedIndex < mainListView.Items.Count)
        {
            // but don't allow more than one indent past above row's indent level
            RowControl rc = (RowControl)mainListView.Items[mainListView.SelectedIndex];
            int indexMinus1 = mainListView.SelectedIndex - 1;
            if (-1 < indexMinus1 && rc.indentProp <= masterList[indexMinus1].indent)
            {
                rc.indentProp++;
            }
        }
        // then update list view
        masterList.UpdateListView(this);
    }

    private void AppBarUnindent_Click(object sender, RoutedEventArgs e)
    {
        // unindent the row control if currently selected index is a list view item
        if (-1 < mainListView.SelectedIndex && mainListView.SelectedIndex < mainListView.Items.Count)
        {
            // but don't allow unindenting off left side of page
            RowControl rc = (RowControl)mainListView.Items[mainListView.SelectedIndex];
            if (rc.indentProp > 0)
            {
                rc.indentProp--;
            }
        }
        // then update list view
        masterList.UpdateListView(this);
    }

    public void AppBarShowCompl_Click(object sender, RoutedEventArgs e)
    {
        dataHandler.SaveUserSettings();

        masterList.UpdateListView(this);
    }

    public void AppBarMarkAsCompleted_Click(object sender, RoutedEventArgs e)
    {
        // toggle hidden state of active entry
        if (-1 < mainListView.SelectedIndex && mainListView.SelectedIndex < masterList.Count)
        {
            masterList[mainListView.SelectedIndex].completed = (masterList[mainListView.SelectedIndex].completed) ? false : true;

            masterList.UpdateListView(this);
        }
    }

}
}

I have added the FileService and SettingsService classes from the opensource Template10 to the project. 我已经将开源Template10中的FileService和SettingsService类添加到了项目中。

The build setting "compile with .NET Native tool chain" was unchecked, I've tried deploying with it checked/unchecked for both debug/release versions, and now the debug version also often hangs on the splash screen? 未选中构建设置“使用.NET Native工具链进行编译”,我尝试使用它来部署/调试/释放两个调试/发布版本,现在调试版本也经常挂在初始屏幕上吗? With it checked, I get a whole bunch of these errors as well: 选中它,我也收到了很多这些错误:

'Sublist.exe' (Win32): Loaded 'C:\Windows\System32\biwinrt.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.

I've tried downloading the server symbols with no success... 我尝试下载服务器符号没有成功...

I found the hang happens at the following line in GetIfFileExitsAsync. 我发现该挂起发生在GetIfFileExitsAsync的以下行中。

retval = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync(key);

I made the following change in you code and it should work now. 我对您的代码进行了以下更改,并且现在应该可以使用。

In DataHandler's constructor, use Task.Run to initialize the userDataList. 在DataHandler的构造函数中,使用Task.Run初始化userDataList。

public DataHandler(MainPage mp)
{
    mainPage = mp;

    settingsHelper = new SettingsHelper();
    fileHelper = new FileHelper();

    LoadUserSettings();
    Task.Run(() =>
    {
        userDataList = LoadUserData();
    });
    Task.WaitAll();
}

I am still not sure why the .net native compile will make this issue, but will try to simplify the project and report it in MS internal channel. 我仍然不确定为什么.net本机编译会导致此问题,但是会尝试简化项目并在MS内部通道中报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM