XAML应用程序抛出.Net System.Windows.Markup.XamlParseException

时间:2018-09-18 13:05:53

标签: c# .net windows xaml desktop-application

将exe和所需的dll从Release文件夹复制到远程位置。并且它显示此错误,并且无法启动应用程序。

应用配置代码。

<?xml version="1.0" encoding="ytf-8" ?>
<configuration>
 <startup>
   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

这是XAML代码。

public partial class MainWindow : Window
        {
            public static string SourceApp = "iaPrefDBConn";
            IALogging iaLogging = new IALogging(SourceApp);
            IRegistry registryWrap = new RegistryWrap();
            IRegistryManager registryManager = null;
            IEnvironment environmentWrap = new EnvironmentWrap();
            IWTSDBConnectionManager wtsdbConnectionManager = null;
            ICommandLineManager cmdLinemanger = null;
            InstantAccess.Core iaCore = new InstantAccess.Core();

            public MainWindow()
            {
                try
                {
                    registryManager = new RegistryManager(registryWrap);
                    cmdLinemanger = new CommandLineManager(registryManager, environmentWrap);
                    wtsdbConnectionManager = new WTSDBConnectionManager(cmdLinemanger);
                    InitializeComponent();
                }
                catch(Exception ex)
                {
                    iaLogging.log(IALogging.LOG_ERROR, "Exception in starting application: " + ex.Message);
                }
            }

这是应用程序错误状态。

Application: iaPrefDBConn_WPF.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
  at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, 
  System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, 
  System.Xaml.XamlObjectWriterSettings, System.Uri)
  at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, 
  Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, 
  System.Uri)
   at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, 
   System.Windows.Markup.ParserContext, System.Object, Boolean)
   at 

0 个答案:

没有答案