CSharp.lua icon indicating copy to clipboard operation
CSharp.lua copied to clipboard

"Compile" a .NET EXE or DLL to Lua

Open 2dpdlja496or43iq opened this issue 2 years ago • 4 comments

Like I suggested on https://github.com/yanghuan/CSharp.lua/issues/422, automatically run the decompiler to decompile to C# then translate to Lua.

2dpdlja496or43iq avatar Apr 23 '23 06:04 2dpdlja496or43iq

In my fork I added the option to give a .csproj file as input, then its package references will be automatically decompiled.

Drake53 avatar Apr 24 '23 19:04 Drake53

#422

yanghuan avatar Apr 25 '23 09:04 yanghuan

In my fork I added the option to give a .csproj file as input, then its package references will be automatically decompiled.

What if I don't have any .csproj and simply want to use a .NET DLL?

2dpdlja496or43iq avatar Apr 29 '23 22:04 2dpdlja496or43iq

Then you'll have to decompile it yourself. In my fork I use the following library for this: https://github.com/icsharpcode/ILSpy

I implemented the decompiler at the following location: https://github.com/Drake53/CSharp.lua/blob/master/CSharp.lua/LuaSyntaxGeneratorFactory.cs#L132 At this point I already extracted the .dll's from the nuget packages so it should be easy to adjust this code for your own needs.

Drake53 avatar Apr 30 '23 06:04 Drake53