Our great sponsors
-
ClearScript
A library for adding scripting to .NET applications. Supports V8 (Windows, Linux, macOS) and JScript/VBScript (Windows).
-
Roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I've had good luck with Microsoft's Clearscript - https://github.com/microsoft/ClearScript)
Others recommended cs script never used it but id imagine its a good option. If wanted to try and do it yourself there is all the tools around the roslyn compiler. That link should be a good start. Funny you mention garrys mod. Facepunch is making a game called s&box (sandbox), in source 2 with c# as it main modding language using roslyn. It even supports hot reloading and its ui is built with the aspnet razor syntax. Regardless, I dont have any advice on using roslyn but it can do enable you to write c# and compile and run that code at runtime.