Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I think I have some answers.</p> <p>To resolve the assembly load problem, I can either place a call to Assembly.LoadWithPartialName inside Mono.CSharp.Driver.LoadAssembly, or do the following in my application</p> <pre><code> AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); private static bool isResolving; static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { if (!isResolving) { isResolving = true; var a = Assembly.LoadWithPartialName(args.Name); isResolving = false; return a; } return null; } </code></pre> <p>To make Mono reuse the same dynamic assembly for each Evaluate/Compile call, all I had to change is the following (although there are probably complexities I'm missing here).....</p> <p>Inside Mono.CSharp.Evaluator, I added the property:</p> <pre><code>/// &lt;summary&gt; /// Gets or sets a value indicating whether to auto reset when evaluations are performed and create a new assembly. /// &lt;/summary&gt; /// &lt;value&gt;&lt;c&gt;true&lt;/c&gt; if [auto reset]; otherwise, &lt;c&gt;false&lt;/c&gt;.&lt;/value&gt; public static bool AutoReset { get; set; } </code></pre> <p>Then...make sure Reset is called at least once in Init:</p> <pre><code> static void Init () { Init (new string [0]); Reset(); } </code></pre> <p>And finally, in ParseString, simply don't reset unless AutoReset is true...</p> <pre><code> static CSharpParser ParseString (ParseMode mode, string input, out bool partial_input) { . . . if (AutoReset) Reset (); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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