简体   繁体   English

如何找出哪个丢失的DLL使我的.NET应用程序在启动时崩溃?

[英]How do I find out which missing DLL is making my .NET application crash on startup?

When dependencies on 3rd party assemblies are added to a typical .NET application it's very easy to forget to add them to the installer. 当对第三方程序集的依赖性添加到典型的.NET应用程序时,很容易忘记将它们添加到安装程序中。 This problem tends to reveal itself only after the application is installed, and in the form of a crash on startup with little helpful information readily available. 这个问题只有在安装应用程序之后才会显露出来,并且在启动时以崩溃的形式显示,并且几乎没有可用的有用信息。

What are the best tools and techniques to find out which assemblies need to be added to the installer? 找出需要添加到安装程序的程序集的最佳工具和技术是什么?

Fully automated builds help reduce the human component and therefore the error. 完全自动化的构建有助于减少人为因素,从而减少错误。 If it's automatically built every time, you know every build will be the same, so once you have it working once, it's always going to work. 如果它每次都自动构建,你知道每个构建都是一样的,所以一旦你有一次工作,它总是会起作用。

We use tools like MSBuild and CruiseControl.net 我们使用MSBuildCruiseControl.net等工具

If you're looking for tools that help your work out the cause of the crash, take a log at the Assembly binding (Fusion) log viewer (or fuslogvw) . 如果您正在寻找可帮助您解决崩溃原因的工具,请在Assembly binding(Fusion)日志查看器(或fuslogvw)上记录日志 If you start it up before you start your app, set the log file location and turn full logging on it will report any attempts to bind assemblies, and list any failures. 如果在启动应用程序之前启动它,设置日志文件位置并打开完整日志记录将报告绑定程序集的任何尝试,并列出任何失败。

Dependency Walker is a great little utility that follows a chain of dependencies from an application or DLL and highlights any that are missing. Dependency Walker是一个很棒的小实用程序,它遵循来自应用程序或DLL的一系列依赖项,并突出显示任何缺少的内容。 It's not really that intuitive for an end user to have to use, but hopefully if you start using it then you'll catch any missing items yourself. 对于最终用户来说,使用它并不是那么直观,但希望如果你开始使用它,那么你将自己捕获任何缺失的物品。

http://www.dependencywalker.com/ http://www.dependencywalker.com/

Depends on the capabilities of your installer. 取决于安装程序的功能。 The VS integrated setup projects can automatically pick up any dependent assemblies. VS集成安装项目可以自动获取任何相关组件。 You might want to check if your installer has some similar features. 您可能想要检查安装程序是否具有某些类似功能。

On the other hand you could instruct your VS projects to copy all dependencies to the output directory and simply include all files from there into your installer. 另一方面,您可以指示VS项目将所有依赖项复制到输出目录,并将所有文件包含在安装程序中。

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

相关问题 .Net CLR如何识别哪个.DLL是Web应用程序中的主要(启动)DLL? - How does the .Net CLR identify which .DLL is the primary (startup) DLL in a web application? 如何找出我的应用程序依赖于BouncyCastle和log4net的位置? - How do I find out where my application depends on BouncyCastle and log4net? 如何在运行时查找导致我的应用程序崩溃的丢失内容? - How can i find what is missing at run time that makes my application crash? 如何在.NET / C#中以编程方式为我的应用程序创建快捷方式(.lnk)添加快捷方式(.lnk) - How do I create add a shortcut (.lnk) for my application to the Startup folder programatically in .NET/C# 如何找到以编程方式构建dll的.net运行时? - How do I find out what .net runtime a dll is built upon programmatically? 如何从powershell中查明.NET dll中是否存在类和方法? - How do I find out if a class and a method exist in .NET dll, from powershell? 如何找出默认的.Net dll rootkit入侵? - How to do you find out default .Net dll rootkit invasion? 我如何找到程序正在使用的mscorlib.dll? - How do I find which mscorlib.dll a program is using? 如何找出调试我的.NET应用程序的调试器? - How can I find out which debugger is debugging my .NET app? 如何找出 .NET Windows Forms 中的焦点是哪个控件? - How do I find out which control has focus in .NET Windows Forms?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM