luainterface

How to create a custom .NET dll loadable for Lua(forWindows)?

一个人想着一个人 提交于 2019-12-10 14:26:12
问题 We are doing a project in .NET framework and want to make most of its functionalities available later for Lua scripts. I thought I could compile a dll and load it to Lua script with the help of LuaInterface. But somehow it did not work. What DID work is the following: require 'luanet' luanet.load_assembly("System.Windows.Forms") Form = luanet.import_type("System.Windows.Forms.Form") Button = luanet.import_type("System.Windows.Forms.Button") form1 = Form() button1 = Button() As you can see,

Passing C# collection to back to Lua

梦想的初衷 提交于 2019-12-10 11:52:26
问题 I have a DLL written in C# that is used by Lua scripts. The scripts "require CLRPackage". So far I can load_assembly() and import_type() to get at the classes and methods in my DLL. I'm passing back simple values and strings, and that all works. No I need to pass a generic collection back to Lua. I believe that what Lua will see is a table, but it isn't clear to me how to create that table in C# and pass it back. This seems to be a similar question, but I'm not seeing how to implement it. Is

LuaInterface - how-to restrict access to .Net classes?

China☆狼群 提交于 2019-12-09 04:51:32
问题 I'm trying to embed some Lua scripting functionality in my C# app by using LuaInterface 2.0.3. This is working just fine so far, but I can't figure out how to restrict access to only few specified .Net classes. By default, all .Net libraries are directly accessible through "luanet" and Lua scripts are free to open new windows or access the file system. e.g. this Lua script will open a new Window: Form = luanet.System.Windows.Forms.Form mainForm = Form() mainForm:ShowDialog() Freedom of

How to use LuaInterface on Mono/Linux

一个人想着一个人 提交于 2019-12-07 06:13:50
问题 When I try to use LuaInterface on Mono on Linux (using Mono 2.0 on Ubuntu 9.04) I get the following exception: ** (App.exe:8599): WARNING **: Method ':.DoDllLanguageSupportValidation ()' in assembly '/home/ulrich/test/Debug/lua51.dll' contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/CLI. According to this web site LuaInterface can be used with Mono. MoMA says that too. Is it possible to recompile lua51.dll to make it compatible

LuaInterface and 64Bit

倖福魔咒の 提交于 2019-12-06 16:45:40
Ok i'm currently using LuaScript v5.1 in a Game engine i'm using. and the handy LuaInterface that comes along with it. i've tested it on a range of systems running a range of OS's. LuaInterface seems to fail on 64bit Operating Systems. Could anyone point me to a 64bit Compiled LuaInterface.dll, or is there any alternative to the LuaInterface that can be used, because LuaInterface is extremely useful and i dont think i would be able to write a more extensive interface by myself using lua51. (I'm not that good, sadly) Any help or links would be greatly appreciated. Thanks alot guys! You can

How to use LuaInterface on Mono/Linux

泄露秘密 提交于 2019-12-05 10:42:25
When I try to use LuaInterface on Mono on Linux (using Mono 2.0 on Ubuntu 9.04) I get the following exception: ** (App.exe:8599): WARNING **: Method ':.DoDllLanguageSupportValidation ()' in assembly '/home/ulrich/test/Debug/lua51.dll' contains native code that cannot be executed by Mono on this platform. The assembly was probably created using C++/CLI. According to this web site LuaInterface can be used with Mono. MoMA says that too. Is it possible to recompile lua51.dll to make it compatible to Mono? LuaInterface looks to be pure C#, but it uses a mixed mode C++/CLI-ified version of the

Loading LuaInterface in .net4

让人想犯罪 __ 提交于 2019-12-04 07:09:37
问题 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? 回答1: You're using the pre-compiled version of LuaInterface

LuaInterface - how-to restrict access to .Net classes?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 03:29:43
I'm trying to embed some Lua scripting functionality in my C# app by using LuaInterface 2.0.3. This is working just fine so far, but I can't figure out how to restrict access to only few specified .Net classes. By default, all .Net libraries are directly accessible through "luanet" and Lua scripts are free to open new windows or access the file system. e.g. this Lua script will open a new Window: Form = luanet.System.Windows.Forms.Form mainForm = Form() mainForm:ShowDialog() Freedom of scripting is great and all, but this is likely to interfere with the hosting app and has some security

Loading LuaInterface in .net4

两盒软妹~` 提交于 2019-12-02 11:42:05
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? 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

C# external library (Lua) call problem

左心房为你撑大大i 提交于 2019-11-28 12:48:08
I'm new to programming in C# (VS2010) .Net (4.0) and I'm encountering I couldn't solve by myself since some days already. I'm using an external scripting language (Lua) in my C# code. To do so I use LuaInterpreter built for .Net 4.0 First try: The project is a console application -> the program works fine when I try to call a Lua class. Second try: The project is a class Librrary COM used from Excel -> The class library compile fine and my user defined functions work fine within Excel. But when I try to call a Lua class it crashed saying that the Lua assembly is missing. Could not load file or