Page 1 of 1

C# and NativeAOT

Posted: 10 May 2023, 23:26
by brgishy
I've been a C# / Unity developer for over 10 years now, but I'm now working on an Unreal project. I'm very excited with all the new tech that came out in .net 7 around NativeAOT. It got me wondering. Has anyone tried to make a C# NoesisGUI project and publish the DLL with NativeAOT and load and run that DLL from inside of Unreal?

I realize it's not the most idea setup. Having Unreal send data to the DLL to update the UI would be more of a pain, but if you have a lot of UI that only relies on basic mouse/keyboard input, it could be a big win. All our backend services are written in C#, so it would be nice not needing to duplicate all the communication classes with C++ counterparts. Also, giving the UI team the ability to create all the game UI outside of Unreal is also a big win IMO.

On a side note, here is a great article showing how "easy" it is to create a native DLL and load/use it in C++ (https://joeysenna.com/posts/nativeaot-in-c-plus-plus).

Re: C# and NativeAOT

Posted: 12 May 2023, 10:52
by hcpizzi
Hi brgishy,

I'm not sure if you're aware of the UnrealCLR project. It's a plugin that supports loading managed assemblies and interop with Unreal. I've never used it myself, nor are we aware of anyone using it, but sounds like a starting point. They are based on .NET 6, so no AOT support. I'm not sure if they have any plans to move to .NET 7 and support AOT compilation, though.

Re: C# and NativeAOT

Posted: 23 May 2023, 01:03
by brgishy
Hi hcpizzi, thanks for the reply. I had heard about it before, but didn't dig too deep into it. I dug a little deeper after you comment and it does a lot of cool stuff that would really help getting NoesisGUI running in Unreal using C#. Sadly I'm not experienced enough with Noesis and Unreal to get this working, so I was hoping that someone else may have tackled this problem already. Thanks for your time!