Skip to content

net8.0调用xlua报错 #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Yqghlx opened this issue May 27, 2025 · 2 comments
Closed

net8.0调用xlua报错 #1195

Yqghlx opened this issue May 27, 2025 · 2 comments

Comments

@Yqghlx
Copy link

Yqghlx commented May 27, 2025

System.MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
at XLua.CodeEmit.get_CodeEmitModule()
at XLua.CodeEmit.EmitDelegateImpl(IEnumerable`1 groups)
at XLua.ObjectTranslator.initCSharpCallLua()
at XLua.ObjectTranslator..ctor(LuaEnv luaenv, IntPtr L)
at XLua.LuaEnv..ctor()

如上所示,当使用net8.0调用时报如上错误。查了下说是动态加载程序集的方法在net5.0+以后变了,但我看lua库里的CodeEmit.cs程序里已经通过预编译指令区分了net framework和net5.0+,为什么还是报错呢?请大神来指点指点吧

@Yqghlx
Copy link
Author

Yqghlx commented May 27, 2025

@chexiongsheng 大佬来帮帮忙

@Yqghlx
Copy link
Author

Yqghlx commented May 27, 2025

我自己把lua.mini编译了一个Net8.0的版本,,试了下可以用,谢谢大佬的源码,膜拜!

@Yqghlx Yqghlx closed this as completed May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant