0

I have a C# application I'm working on with which I want to use the excellent LuaInterface. However when I run the application I get this exception when I try to do something with LuaInterface:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

What additional configuration information can I give to make this load properly?

Martin
  • 12,469
  • 13
  • 64
  • 128
  • http://social.msdn.microsoft.com/Forums/en-US/clr/thread/58271e39-beca-49ac-90f9-e116fa3dd3c0 – kenny Oct 02 '10 at 02:22
  • possible duplicate of [Mixed mode assembly in .NET 4](http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4) – Hans Passant Oct 02 '10 at 02:37
  • The solution mentioned there (modifying app.config) doesn't seem to work for this :/ – Martin Oct 02 '10 at 12:15

1 Answers1

1

You're using the pre-compiled version of LuaInterface which was built against the 2.0 version of the framework or didn't change the build settings in the LuaInterface project. Change the target framework to the same version as you're building your application and build the library yourself. Your problem will be solved this way.

Deathspike
  • 8,582
  • 6
  • 44
  • 82
  • I tried that, However the Lua 5.1.2 project has build errors, so I can't rebuild that to target .net4 – Martin Oct 11 '10 at 08:48
  • I'm guessing you are using Visual Studio 2010 which needs a few type casts before it compiles correctly. LuaInterface has no issues though but it depends on Lua binary to be compiled correctly. It shouldn't be too hard to do. – Deathspike Oct 11 '10 at 10:59
  • Right, I'll have to give that a go. I'm not terribly familiar with C++, but I should be able to manage a few type casts ;) – Martin Oct 11 '10 at 15:40