wpf Visual Studio 安装程序中的依赖项和 DLL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15743106/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Dependencies and DLL in Visual Studio Installer
提问by KMC
I am using VS2010's Visual Studio Installerto deploy my application to an MSI.
我正在使用 VS2010 的Visual Studio 安装程序将我的应用程序部署到MSI。
I referenced numerous DLLs during development; some are 3rd parties, while some are system DLLs. Now during deployment, I do not know what to include or exclude. Visual Studio automatically included Detected Dependenciesafter I added the output .EXE but they are usually not sufficient to run the application. I often had to manually include the development's DLLs to the installed application folder. Otherwise, eventvwrwould just provides a generic CLR20r3error that only tells me missing DLLs but not indicating which one.
我在开发过程中引用了许多 DLL;有些是第 3 方,而有些是系统 DLL。现在在部署期间,我不知道要包含或排除什么。在我添加输出 .EXE 后,Visual Studio 会自动包含检测到的依赖项,但它们通常不足以运行应用程序。我经常不得不手动将开发的 DLL 包含到已安装的应用程序文件夹中。否则,eventvwr只会提供一个通用的CLR20r3错误,它只会告诉我缺少 DLL,但不会指示是哪个。
It became a habit (a very bad habit, IMO) to include ALL references in my deployment project as they are referenced in my development project, but I guess uninstallation of the application may possibly remove System DLLs that causes problems to other application.
在我的部署项目中包含所有引用已成为一种习惯(一个非常坏的习惯,IMO),因为它们在我的开发项目中被引用,但我猜卸载应用程序可能会删除导致其他应用程序出现问题的系统 DLL。
So how would I know which DLLs to include manually in the deployment project, in addition to the Detected Dependencies?
那么,除了Detected Dependencies之外,我怎么知道在部署项目中手动包含哪些 DLL呢?
采纳答案by Steve
All of your thirdy party dlls need to be distributed with your application.
You need to check the documentation of these libraries to get a precise answer.
您的所有第三方 dll 都需要与您的应用程序一起分发。
您需要查看这些库的文档以获得准确的答案。
As a rule of thumb, look at the References section of your projects.
Note down the libraries used there and then check with the documentation if additional libraries, not detected by VS, are needed. Sometime these libraries provides a 'Redistributable Package' that you can include in your setup project.
根据经验,请查看项目的参考资料部分。
记下那里使用的库,然后检查文档是否需要 VS 未检测到的其他库。有时,这些库会提供一个“可再发行包”,您可以将其包含在您的安装项目中。
I prefer to do this work manually and always test in a empty virtual machine. It is very embarrassing to have a failed setup when your customers install the application.
我更喜欢手动完成这项工作,并始终在空虚拟机中进行测试。当您的客户安装应用程序时设置失败是非常尴尬的。
To deinstall, you really have nothing to worry if you install everything in your application folder.
要卸载,如果您将所有内容都安装在应用程序文件夹中,您真的没有什么可担心的。

