This project has moved to GitHub:


DynamicLua is a wrapper for the LuaInterface heavily using the .NET 4 "dynamic" Feature. (LuaInterface is a Lua<->C# Bridge)
It makes it easier and more idiomatic to use Lua in C# Code. DynamicLua is written in C# and includes unit tests for nearly everything. Most of the tests are converted from the LuaInterface project.
Although a copy of LuaInterface is included in the Repository, the DynamicLua work completely above LuaInterface. The reason why it's included is easy: The current version has some bugs that
affect DynamicLua, and these bugs are fixed in the includes version. But it should be possibly to use DynamicLua even with the original version of LuaInterface.


  • Easy access to Lua
  • Use Lua-Metatables in C# (see documentation)
  • Nearly complete unit-tested
  • Works as you expect it to
  • OpenSource under Apache License 2.0
  • It's free...

Code Example:

// Start a new Lua interpreter
dynamic lua = new DynamicLua.DynamicLua(); //Namespace and class name are the same!
// Run Lua chunks
lua("num = 2"); //no DoString()!
lua("str = ’a string’");
// Read global variables ’num’ and ’str’
double num = lua.num; //No explicit casting, no index operator!
string str = lua.str;
// Write to global variable ’str’
lua.str = "another string"; //No index operator
//Increase a global value
lua.num += 10; //A LOT cleaner

There a more features witch makes it much easier to use Lua in C#. All features are explained on the Features site.

Project Status

A lot of the work is done. Some of the implemented features a shown in the Examples above.
There is still some polishing to be done, and some problems to be solved. Detailed information on every feature's status is available on the Features site.


This project is currently developed only by me. I appreciate any help, just have a look on the Issue Tracker. You can contact me in German or English at mail.png.


(Logo based on Story Bridge by Cyron under CC-BY-2.0)

Last edited Mar 3, 2014 at 12:45 PM by simsmaster, version 13