Mods / RoslynSourceCompiler

Draft
Set to published to be listed. A draft mod is still visible to everyone via direct link
Category: #Utility
Author: Fulgen
Side: Both
Created: Jul 24th 2021 at 8:56 AM
Last modified: Jul 24th 2021 at 9:55 AM
Downloads: 115
Follow Unfollow 0

This mod replaces the builtin C# source mod compiler with Roslyn, allowing Vintage Story to compile source files using features of C# > 5.0.

Example:

using Vintagestory.API.Common;
using Vintagestory.API.Server;

[assembly: ModInfo("csharptest")]

public class CSharp7Mod : ModSystem
{
    public override bool ShouldLoad(EnumAppSide forSide) => forSide == EnumAppSide.Server;

    private object Foo() { return new object(); }
    public override void StartServerSide(ICoreServerAPI api)
    {
        api.Logger.Notification("CSharp7Mod {0}", Foo()?.ToString());
    }
}

To use it, simply put the DLL into your mod path. No further steps required.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
No releases found

0 Comments (oldest first | newest first)

(edit comment delete)