[Mono-list] Embedding mono

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Tue, 22 Jun 2004 10:40:49 -0300


inline:
On Fri, 2004-06-18 at 08:40, Jonathan Pryor wrote:
> On Fri, 2004-06-18 at 05:08, Joe Ante wrote:
> > Our script files are currently not stored as individiual text files instead
> > they are serialized in one big file. Is it possible to pass mono a c string
> > for compiling instead of a file?

Yes, see below

> It's mcs which does the compiling, and mcs reads from files.  So No, you
> can't store the scripts as a C-string within your program.

Sorry Jon, I tend to disagree, when looking at it as what we have as
exposed functionality. See below

> If the user can add their own scripts, you could store them as strings
> within a large file, but you'd have to write them to a temp file for mcs
> to compile.  You could then dynamically load the new assemblies at
> runtime.

Just to make it less frightening. We already have classes/methods to do
just that (compile a source passed as a string) for C#/VB.NET, the same
ones ASP.NET uses: CSCodeCompiler and VBCodeCompiler. It currently does
make all the same hard work of saving to a temp file, exec'ing the
compiler and parsing the results, but it's already done, so who needs
just can use it.

Just clarifying things a bit, 

-- 
Rafael "Monoman" Teixeira 
Mono Hacker since 16 Jul 2001 - http://www.go-mono.org/
Mono Brasil Founding Member - http://monobrasil.redesolbrasil.org/
English Blog: http://monoblog.blogspot.com/
Brazilian Portuguese Blog: http://monoblog.weblogger.terra.com.br/