Nesting boo in C # doesn't recognize build execution

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

+7
source share
2 answers

Imported namespaces in BOO must contain at least one public type for successful import; otherwise, you will get error BCE0021 , so you want to make sure that the Enemy type is public (or other).

+3
source

I don't know Boo or C #, but I found someone asking a similar question in the Boo Programming Google Group. The question they asked:

Namespace 'Pathfinding' not found, maybe you forgot to add a link to the assembly?

In particular, they got this error:

I am converting some existing code from C # to Boo. One of my classes had a "use Pathfinding", which was converted to an "import" Pathfinding "by a script converter.

I get this error when trying to compile:

Assets / Script / VehicleController.boo (4.8): BCE0021: "Pathfinding" namespace not found, maybe you forgot to add the assembly Help?

The Pathfinding library that I use is written in C #. Could this be the cause of the problem? Is there anything extra I need to do to make this work?

It looked like your error message, and the solution that was mentioned was that you had to transfer your scripts to your compilation stage earlier to make sure that they are available from scripts written in other languages.

This URL has been specified as a link / source for more information about compiling the script.

+1
source

All Articles