简体   繁体   English

服务无法启动。 System.IO.FileNotFoundException:无法加载文件或程序集“ assemblyname.dll”

[英]Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly “assemblyname.dll”

NOTE: I have done exhaustive research on this question, there are many supposed solutions out there, none of which have actually worked for me. 注意:我已经对这个问题进行了详尽的研究,那里有许多假定的解决方案,但实际上没有一个对我有用。

After successfully installing a windows service onto a clients computer, I notice that it doesn't start automatically as it is supposed to. 在将Windows服务成功安装到客户端计算机后,我注意到该服务不会自动启动。 When I try to start it manually, I get the error above. 当我尝试手动启动它时,出现上面的错误。 I took a look at the Events Viewer log, and here is the error logged there: "Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly "assemblyname.dll" or one of it's dependencies. The specified module could not be found" 我查看了事件查看器日志,这里记录了错误:“服务无法启动。System.IO.FileNotFoundException:无法加载文件或程序集“ assemblyname.dll”或其依赖项之一。指定的模块找不到”

It turns out that my .dll, even though I can see it in the installation folder (I did the side-by-side), the system is not able to connect to it. 事实证明,即使可以在安装文件夹中看到我的.dll(我并排执行),系统也无法连接到它。 Someone suggested making sure the application file name and the config file name match, mine already did, and my service is set to run on the Local System Account. 有人建议确保应用程序文件名和配置文件名匹配,我的已经匹配,并且我的服务设置为在本地系统帐户上运行。 NOTE: Everything works fine on the dev box, and the client machine has the requisite 4.5 .NET framework for the service to run. 注意:一切都可以在dev框上正常运行,并且客户端计算机具有运行该服务所需的4.5 .NET框架。

QUESTION: How can I correct this? 问题:我该如何纠正? How can I make sure the system on the client machine is able to see the .dll file that the service uses? 如何确保客户端计算机上的系统能够看到该服务使用的.dll文件?

Any help is appreciated here. 感谢您的帮助。 Let me know if further clarification is needed. 让我知道是否需要进一步澄清。

Thanks 谢谢

Possible solution 可能的解决方案

Try compiling it in x86, could be a 64-bit dll, make sure you have the 32-bit version. 尝试在x86中进行编译,可能是64位dll,请确保您具有32位版本。

OK guys I finally solved my problem. 好的,我终于解决了我的问题。 I ran dependency walker and It gave me a list of dlls that were missing, but it turned out they had nothing to do with the dll I was using. 我运行了Dependency Walker,它给了我一个丢失的dll列表,但是事实证明它们与我使用的dll没有关系。 But I decided to install Windows SDK for Win 7 with the redistributables, and this solved the problem i was having. 但是我决定使用可再发行文件安装Windows 7 for Win 7,这解决了我遇到的问题。 There you have it folks, hope this helps someone else going forward. 那里的人们,希望这对其他人有所帮助。 Cheers! 干杯!

暂无
暂无

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

相关问题 服务无法启动。 System.IO.FileNotFoundException - Service cannot be started. System.IO.FileNotFoundException System.IO.FileNotFoundException:无法加载文件或程序集。 系统找不到文件SharpSvn.dll - System.IO.FileNotFoundException: Could not load file or assembly. The system cannot find the file SharpSvn.dll 如何修复 System.IO.FileNotFoundException:无法加载文件或程序集“ScanAPIHelper.dll”或其依赖项之一 - How to fix System.IO.FileNotFoundException: Could not load file or assembly 'ScanAPIHelper.dll' or one of its dependencies 奇怪的错误:System.IO.FileNotFoundException:无法加载文件或程序集 - Weird Error: System.IO.FileNotFoundException: Could not load file or assembly System.IO.FileNotFoundException: 无法加载文件或程序集 C# - System.IO.FileNotFoundException: Could not load file or assembly C# System.IO.FileNotFoundException:无法加载文件或程序集 - System.IO.FileNotFoundException: Could not load file or assembly System.IO.FileNotFoundException: '无法加载文件或程序集 - System.IO.FileNotFoundException: 'Could not load file or assembly 无法加载文件或程序集System.IO.FileNotFoundException - Could not load file or assembly System.IO.FileNotFoundException 无法加载程序集>> System.IO.FileNotFoundException:无法加载文件或程序集'System.Core, - Unable to Load assembly>>System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, 在我的Windows服务上,我收到一条错误消息,发生了System.IO.FileNotFoundException:无法加载文件或程序集 - on my Windows Service, I am recieving an error proccesed out System.IO.FileNotFoundException: Could not load file or assembly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM