Note that there are some explanatory texts on larger screens.

plurals
  1. POEmbedding boo in C#, does not recognise executing assembly
    primarykey
    data
    text
    <p>scripts/ai/Dream.boo</p> <pre><code>import CultLib import LonelyHero class Dream(Enemy): pass </code></pre> <p>C#</p> <pre><code>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); } </code></pre> <p>In the line <code>bc.Parameters.References.Add(Assembly.GetExecutingAssembly());</code> I add the executing assembly, which contains the namespace "LonelyHero". However, the error</p> <blockquote> <p><em>rsc/script/ai/Dream.boo(2, 8): BCE0021: Namespace LonelyHero not found. maybe you forgot to add an assembly reference?</em></p> </blockquote> <p>appears.</p> <p>LonelyHero should exist, why does this error occur and what can I do to resolve it?</p> <p>Note: Upon replacing <code>Assembly.GetExecutingAssmebly()</code> with <code>Assembly.GetAssembly(typeof(Enemy))</code> , thus assuring it adds the assembly with a class under the LonelyHero namespace, the same error occurs. Also with <code>Assembly.LoadFile(new DirectoryInfo("LonelyHero.exe").FullName)</code></p> <p>Occurs in Boo 0.9.4.9 and booxw-1203</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload