简体   繁体   English

具有C#WPF VS 2015的MSI安装程序

[英]MSI installer with c# WPF VS 2015

I have created a simple wpf application in c# with only one window, MainWindow.xaml. 我已经在c#中创建了一个简单的wpf应用程序,其中只有一个窗口MainWindow.xaml。 There is no database, not even textboxes, not a single line of code added by myself. 没有数据库,甚至没有文本框,也没有我自己添加的一行代码。

file structure wpf project 文件结构WPF项目

I also created an MSI setup project: 我还创建了一个MSI安装项目:

setup project 设置项目

Building of either project works without problem. 任何一个项目的建设都没有问题。 However, after installation, when I try to run the programme crashes without any error message. 但是,安装后,当我尝试运行该程序时会崩溃,而没有任何错误消息。 All that I see is that the circle-turned cursor is spinning and the windows explorer window can no longer be closed. 我所看到的只是旋转的光标正在旋转,并且无法再关闭Windows资源管理器窗口。

Operating system is Windows 10. Anyone has had a similar experience? 操作系统是Windows10。有人曾有过类似的经历吗? Looks like a bug in the MSI installer. 看起来像MSI安装程序中的错误。

Check all the .dll's are included in the installer. 检查安装程序中是否包含所有.dll。 Often not all of them are and you need to manually include them. 通常它们并不是全部,您需要手动将它们包括在内。 You can compare what's in the install (C:\\Program Files...) directory compared to what's in the project bin directory. 您可以将安装目录(C:\\ Program Files ...)中的内容与项目bin目录中的内容进行比较。 Often times items like "PresentationFramework.Aero.dll" aren't included and you get a missing .dll error. 通常,不包含“ PresentationFramework.Aero.dll”之类的项目,并且您会丢失.dll错误。

If this is the case, you can copy over some of the .dll's until it works. 在这种情况下,您可以复制一些.dll,直到它起作用为止。 Then add those to the installer. 然后将它们添加到安装程序。

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

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