LuaInterface - FileNotFoundException

1.1k Views Asked by At

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?

3

There are 3 best solutions below

9
On BEST ANSWER

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.

0
On

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."

0
On

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.