Scripts / ai / Dream.boo
import CultLib import LonelyHero class Dream(Enemy): pass
FROM#
var bc = new BooCompiler(); bc.Parameters.Input.Add(new FileInput("rsc/script/ai/" + "Dream" + ".boo")); bc.Parameters.Pipeline = new CompileToMemory(); bc.Parameters.References.Add(Assembly.GetExecutingAssembly()); bc.Parameters.References.Add(Assembly.LoadFile(new DirectoryInfo("CultLib.dll").FullName)); bc.Parameters.References.Add(Assembly.LoadFile(new DirectoryInfo("sfmlnet-audio-2.dll").FullName)); bc.Parameters.References.Add(Assembly.LoadFile(new DirectoryInfo("sfmlnet-graphics-2.dll").FullName)); bc.Parameters.References.Add(Assembly.LoadFile(new DirectoryInfo("sfmlnet-window-2.dll").FullName)); var cc = bc.Run(); if(cc.GeneratedAssembly!=null) { cc.GeneratedAssembly.CreateInstance("Dream", true, BindingFlags.NonPublic, null, new object[] {Parent, pos}, null, null); } else { foreach (var error in cc.Errors) Console.WriteLine(error); }
In the line bc.Parameters.References.Add(Assembly.GetExecutingAssembly()); I am adding an executable assembly that contains the namespace "LonelyHero". However mistake
rsc / script / ai / Dream.boo (2, 8): BCE0021: LonelyHero namespace not found. Did you forget to add the assembly link?
will appear
.
LonelyHero must exist, why does this error occur and what can I do to solve it?
Note: When replacing Assembly.GetExecutingAssmebly() with Assembly.GetAssembly(typeof(Enemy)) , thereby guaranteeing that the assembly is added to the class in the LonelyHero namespace, the same error occurs. Also with Assembly.LoadFile(new DirectoryInfo("LonelyHero.exe").FullName)
Occurs in Boo 0.9.4.9 and booxw-1203
Gavin gassmann
source share