So I’m trying to find gmcs and all it throws me are these errors under MacOS Yosemite (Unity5).
SystemException: Error running gmcs: Cannot find the specified file
My line is:
genPath = Directory.GetCurrentDirectory() + “/Assets/Mark2/Code Generation/Generated Code/”;
For some reason, it just can’t see it. I installed mono again, I reinstalled Unity, I did everything I could, even adding the PATH to my system, but it just can’t find it.
I found this thread (Error running gmcs: Cannot find the specified file · Issue #21 · AngryAnt/Behave-release · GitHub) but they could not solve it either. Not sure what is firing this error under Yosemite. In Windows works like a charm.
If someone can lend a hand, I’m all ears.
Same problem with me.
CompilerParameters parameters = new CompilerParameters();
parameters.GenerateExecutable = false;
parameters.OutputAssembly = "AutoGen.dll";
// Here I have same Exception
CompilerResults r = CodeDomProvider.CreateProvider("CSharp").CompileAssemblyFromSource(parameters, "public class B {public static int k=7;}");
Console.WriteLine(Assembly.LoadFrom("AutoGen.dll").GetType("B").GetField("k").GetValue(null));
The funny thing is that I try to compile from source string not from file…
Same problem with me.
CompilerParameters cplist = new CompilerParameters();
cplist.GenerateExecutable = false;
cplist.GenerateInMemory = true;
cplist.ReferencedAssemblies.Add("System.dll");
cplist.ReferencedAssemblies.Add("System.XML.dll");
cplist.ReferencedAssemblies.Add("System.XML.dll");
cplist.ReferencedAssemblies.Add("System.Web.Services.dll");
cplist.ReferencedAssemblies.Add("System.Data.dll");