0

I'm getting this error when I'm running the compiled .cs script: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'TheEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. File name: 'TheEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

This is the .cs script:

using TheEngine;

public class Class1 
{
    void Start ()
    {
        TheGameObject go = new TheGameObject(); //TheGameObject is a class in TheEngine.dll
        go.SetName("Hi!");
    }

    void Update ()
    {

    }
}

This is the command used to compile the script: mcs_path\mcs -target:library -out:scripts_assemblies_path\Class1.dll -lib:assemblies_path\TheEngine.dll -r:assemblies_path\TheEngine.dll script_path\Class1.cs

If I move the TheEngine.dll to the same folder as the newly created Class1.dll when I'm running the script it works but I want to have the compiled scripts in a folder and the reference .dlls in another.

Edit: Sorry I used incorrect tags and some info is missing.

I'm implementing a C# scripting system for a C++ project (Game Engine) using Mono. I'm actually calling the compile command inside this project using System(..);. I don't have the .cs scripts inside a C# project to compile them when compiling the project.

Tino Tano
  • 159
  • 1
  • 13
  • You can add dll to project by using Solution Explorer and use Add Existing item and then browse to folder where Engine.dll is located. The VS build process will compare date of dll in bin folder and if new automatically copy the dll to the project bin folder. – jdweng Dec 05 '17 at 19:39
  • @jdweng Sorry. I'm not using a project to compile the scripts. Some info was missing, check the "Edit" section. – Tino Tano Dec 05 '17 at 21:26

0 Answers0