Supremo
Supremo

Reputation: 13

Compiling .cs file into dll without Visual Studio

How do I compile a .cs file to a .dll file without using Visual Studio?

Here is an example file:

using UnityEngine;

namespace Test
{
    public class Loader
    {
        public static GameObject load_object;

        public static void Load()
        {
            load_object = new GameObject();
            load_object.AddComponent<GG>();
            UnityEngine.Object.DontDestroyOnLoad(load_object);
        }
    }
}

Upvotes: 0

Views: 2012

Answers (1)

Pawel Maga
Pawel Maga

Reputation: 5787

If you have .NET Framework installed, run this command:

C:\Windows\Microsoft.NET\Framework\{version}\csc.exe yourfile.cs

Of course all dependencies must be in place.

You can find more information about this kind of compilation: here

Upvotes: 1

Related Questions