mardi 18 février 2020

How to add environment variable to evulator mono sharp

I wrote a program that runs dynamic runtime codes. I am using Evulator class to do this. This is setup lines for executer.

 this._reportWriter = new StringWriter();
        this._settings = new CompilerSettings();
        this._settings.ReferencesLookupPaths.Add(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "xxx.dll"));
        this._settings.ReferencesLookupPaths.Add(AppDomain.CurrentDomain.BaseDirectory);
        this._settings.LoadDefaultReferences = true;
        this._settings.AssemblyReferences.Add("xxx.dll");
        this._evaluator = new Evaluator(new CompilerContext(this._settings, new StreamReportPrinter(_reportWriter)));

I am running this program concurrently. In our program, the xxx.dll uses environment_variable to start server. So that, I have to set environment_variable for each processes in itself with different values. Can i set environment variable in evaluator settings just for that process ?

Thanks





Aucun commentaire:

Enregistrer un commentaire