LuaInterface - FileNotFoundException
我正在尝试让 Lua 系统在我的 .NET 4.0 应用程序中运行。我使用 LuaInterface 作为 Lua 的包装器,它是在 .NET 4.0 下编译的
。在安装了 VS2010 的开发计算机上运行 Lua 脚本时,应用程序运行得非常好。但是当在另一台计算机上运行它时,我收到 FileNotFoundException。
System.IO.FileNotFoundException:无法加载文件或程序集“lua51.dll”或其依赖项之一。找不到指定的模块。
lua51.dll 与应用程序位于同一文件夹中,因此我没有看到任何问题。所以这肯定意味着它找不到lua51.dll所依赖的文件。这就是问题所在。
我需要让我的用户安装哪些文件才能使其正常工作?
I am trying to get a Lua system working in my .NET 4.0 application. I am using LuaInterface as the wrapper for Lua, which is compiled under .NET 4.0
The application runs perfectly fine when running Lua scripts on my development computer, which has VS2010 installed. But when running it on another computer I get a FileNotFoundException.
System.IO.FileNotFoundException: Could not load file or assembly 'lua51.dll' or one of its dependencies. The specified module could not be found.
The lua51.dll is in the same folder as the application, so I don't see any problem there. So that must mean that it cannot find a file that lua51.dll depends on. And this is the problem.
Which files do I need to get my users to install to get this working correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Fusion Binding 日志记录对此进行分析。这可以在命令行中完成、记录到文件中或通过 GUI 界面 (FUSLOGVW.exe) 查看。开始 在这里看看这是否能让你开始。
You can analyze this by using Fusion Binding logging. This can be done at the command line, logged to a file, or viewed through a GUI interface (FUSLOGVW.exe). Begin here and see if that gets you started.
如果您的开发系统和出现问题的系统不是同一架构(32 位 -> 64 位),则可能会导致出现问题。我在C#外部库(Lua)回答了类似的问题调用问题
“我在 64 位计算机上与 .NET、LuaInterface 和 Lua5.1 交互时遇到了很多问题。 Lua5.1 仅编译 32 位,这需要您(我相信)将 LuaInterface 项目也构建为 32 位。属性->构建-> .NET 项目中的“平台目标”为“x86”。
If your development system and the system with the issue aren't the same architecture (32-bit -> 64-bit), it can cause you issues. I answered a similar question to this at C# external library (Lua) call problem
"I've had lots of issues with .NET, LuaInterface, and Lua5.1 interracting on 64-bit machines. Lua5.1 only compiles 32-bit and this requires you to (I believe) build the LuaInterface project as 32-bit as well. Try changing "Project -> Properties -> Build -> Platform Target" to "x86" in your .NET projects."
我也有同样的问题。
我通过安装 microsoft 的 vcredist_x86.exe(Visual C++ 2010 Redistributable Package)解决了这个问题,它将所需的 DLL 添加到系统中。
我尝试使用 /MT 选项编译 lua51.dll,但该选项与 /CLR 选项不兼容,而 /CLR 选项是必需的。
然后我尝试安装 redist 包 2008 (就像 LuaInterface 网站所说的那样),但它不起作用(也许我自己用 VS 2010 编译了 lua - 我不知道更多了)。 2010版解决了我的问题。
I had the same problem.
I solved it by installing the vcredist_x86.exe (Visual C++ 2010 Redistributable Package) from microsoft, which adds the needed DLLs to the system.
I tried to compile lua51.dll with /MT option, but this option is incompatible with the /CLR option, which is needed.
Then i tried to install the redist package 2008 (like the LuaInterface site says) which didn't work (maybe i compiled lua myself with VS 2010 - i don't know any more). The 2010 version solved my problem.