WPF 应用程序无法通过文件关联打开

WPF application can not open by file associate

我有一个 WPF 应用程序,我使用 MVVM 的 Caliburn 微型库。

public class AppBootstrapper : BootstrapperBase{
  protected override void OnStartup(object sender, StartupEventArgs eventArgs)
  {
     LoadUserConfigData();

     if (eventArgs.Args.Count() != 0)
     {
       MessageBox.Show(eventArgs.Args[0]);
     }
     else
     {
       MessageBox.Show("no");
     }
     StartProgram();
  }
}

这是我的 xaml

<Application x:Class="Mat.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Mat">
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary>
          <local:AppBootstrapper x:Key="bootstrapper" />
        </ResourceDictionary>

        <ResourceDictionary Source="/UIStyle;component/UIStyle.xaml"/>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Application.Resources>
</Application>

我使用 NSIS 创建安装程序 exe 文件,并通过 NSIS 脚本注册文件关联。 但是当我双击文件时除了光标正在加载之外没有任何反应。

非常感谢您的建议。

我遵循@krzysztof skowronek 的方向,我将我的应用进程附加到 Visual studio,然后进行调试。它没有启动的原因是它有未处理(记录)的异常。