突然遇到这烦恼的问题,由于心情不好,导致处理了好久。

 

解决办法:

1.从简单的路径检查: /page1.xaml, .../page.xaml

2.从程序集检查:

var nameHelper = new AssemblyName(Assembly.GetExecutingAssembly().FullName);

 

            var version = nameHelper.Version;

            var full = nameHelper.FullName;

            var name = nameHelper.Name;

 

3.从URLmap检查:

      <navigation:UriMapper x:Key="UriMapper">

            <navigation:UriMapper.UriMappings>

                <navigation:UriMapping Uri="" MappedUri="/MainPage.xaml"/>

                <navigation:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>

                <navigation:UriMapping Uri="/{pageName}/{key}" 

                                   MappedUri="/Views/{pageName}.xaml?entityGuid={key}"/>

            </navigation:UriMapper.UriMappings>

        </navigation:UriMapper>

        

 

真正解决:

在异常退出发现:

   private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // A navigation has failed; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
        }

 

其中的naveigationFailedEventArgs e的e显示 no xaml in view/setting.

说明我设置了Url map,但没有写好导航的格式。

至此问题解决。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-09-24
  • 2021-07-24
  • 2021-07-05
  • 2022-01-16
猜你喜欢
  • 2021-05-25
  • 2021-10-08
  • 2022-12-23
  • 2021-10-29
  • 2022-02-01
  • 2021-07-10
  • 2021-08-29
相关资源
相似解决方案