0

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?

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
ZeunO8
  • 422
  • 6
  • 25

3 Answers3

0

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.

JCH2k
  • 3,361
  • 32
  • 25
0

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.

Dono
  • 1,254
  • 13
  • 30
  • Thanks for the reply. This looks like it could be good. I'm testing for the Exception using a VM so I can do this from this computer which is good. How can I get the DEBUG Build Environment installed? – ZeunO8 Oct 19 '11 at 07:26
  • Could you please clarify what "DEBUG Build Environment" means? – Dono Oct 19 '11 at 07:49
  • My bad, Very badly explained. What I was searching for was the ability to use FUSLOGVW.exe on my VM, because I don't have VS2010 installed on it. But looking at this answer - http://stackoverflow.com/questions/1012252/using-fuslogvw-exe-on-a-machine-with-no-visual-studio-installed helped me alot – ZeunO8 Oct 19 '11 at 07:55
  • Yeah, just copy it over. But FUSLOGVW.exe really is not necessary. The messages could be output to the console or to a file as well. Whatever works best for you. – Dono Oct 19 '11 at 08:03
  • This is very unusual.. There is no errors in the logs that I can find. And there are only two. One for Luainterface.dll and one for lua51.dll, both show as being loaded successfully. Any ideas? – ZeunO8 Oct 19 '11 at 08:19
  • For now I used the v1.5.3 ( http://files.luaforge.net/releases/luainterface/luainterface/1.5.3 ) of LuaInterface, which does not rely on CIL, and it worked. I would still like to use the latest versions. So if anyone has a solution to this, it would still be appreciated. – ZeunO8 Oct 19 '11 at 11:05
  • 1
    He's having trouble with *unmanaged* DLLs, fuslogvw.exe only shows binding for managed assemblies. He's missing msvcr100d.dll. A build problem, use /MT and build the release version. – Hans Passant Oct 19 '11 at 11:43
  • @Hans: post that as an answer :) – sbk Oct 19 '11 at 15:49
  • Kinda hoping that somebody else would :) Stepping somebody through proper C/C++ build settings is hard work that never gets voted on. – Hans Passant Oct 19 '11 at 15:54
0

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

Community
  • 1
  • 1
kyork
  • 713
  • 5
  • 14