部署后Wpf exe文件崩溃

时间:2018-12-10 19:21:28

标签: c# wpf windows windows-installer setup-project

我的wpf应用程序使用Windows.winmd和System.Windows.Runtime dll,并且我一直在尝试使用Visual Studio安装程序安装程序项目来部署该应用程序。

当我尝试构建安装项目时,它会静默失败并显示此非描述性错误:

ERROR: An error occurred while validating. HRESULT = '80070057

从此链接获取帮助:Could not load file or assembly Windows.winmd'我了解到,在wpf应用程序中引用winmd文件时,需要手动将文件手动添加到“应用程序文件夹”,在手动添加.exe之后,我这样做了。文件,它将dll添加到“应用程序文件夹”,现在我可以构建安装项目,但它仍显示以下警告:

WARNING: Unable to find dependency 'WINDOWS' (Signature='(null)' Version='255.255.255.255') of assembly 'System.Runtime.WindowsRuntime.dll'
WARNING: Unable to find dependency 'MATERIALDESIGNCOLORS' (Signature='(null)' Version='2.5.0.1205') of assembly 'MaterialDesignThemes.Wpf.DLL'
WARNING: Unable to find dependency 'WINDOWS' (Signature='(null)' Version='255.255.255.255') of assembly 'Scout_Windows.exe'

我添加文件有误吗?

从生成的setup.msi文件安装应用程序后,当我启动.exe文件时,它不会启动。事件查看器显示两个错误,应用程序错误:

Faulting application name: Scout_Windows.exe, version: 1.0.0.0, time stamp: 0xaf6df283
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x015909b0
Faulting process ID: 0x2f58
Faulting application start time: 0x01d4907c33342151
Faulting application path: D:\temp\scout\Scout_Windows.exe
Faulting module path: unknown
Report ID: d0cf8414-8f12-4166-8836-ba1ec5ca8c80
Faulting package full name: 
Faulting package-relative application ID: 

.Net运行时错误:

Application: Scout_Windows.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
  at Scout_Windows.App..ctor()
  at Scout_Windows.App.Main()

这是安装项目中我的“应用程序文件夹”内容的快照

enter image description here

我花了两天时间解决这个错误!任何帮助表示赞赏。

0 个答案:

没有答案