gpt4 book ai didi

应用程序启动时出现 C# 错误 - 无法加载文件或程序集

转载 作者:太空狗 更新时间:2023-10-29 22:32:54 25 4
gpt4 key购买 nike

一些用户(我会说它是 ~10%)在尝试运行我用 C# (.NET 4.0) 编写的应用程序时遇到问题 - 在应用程序启动时出现这样的错误:

Could not load file or assembly 'lua51.dll'. Such module could not be found.

- 是翻译,所以在ENG版本中可能是类似的。

问题是大多数用户没有遇到这个问题,lua51.dll 存在于程序目录中。这个错误的原因可能是什么?

我在我的项目中设置了平台:x86->构建选项,出现错误。

最佳答案

这是一个普遍的问题,太多的程序员只是复制DLL而没有意识到lua51.dll本身也有需要安装的依赖DLL。来自 Windows 的错误消息很遗憾没有帮助,它没有报告问题的真正原因。 Applciation 日志中的事件确实如此,但没有足够的用户查看它。

不幸的是,这并没有经常出错,许多机器已经有可用的依赖 DLL。然而,这是一个意外,你不能依赖它。这些几率也越来越低,依赖性越来越旧。

您需要阅读 Install Notes了解需要什么:

Lua for Windows and it's modules all depend on the MSVC++ 2005 runtime library. Lua for Windows install will automatically download this runtime and install it for you if you don't have runtime installed on your computer. The runtime is contained in the file vcredist_x86.exe

所以要么依赖 Lua 安装程序,要么自己安装 vcredist。

关于应用程序启动时出现 C# 错误 - 无法加载文件或程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16635069/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com