Triggered by #464
What?
It should be possible to specify an alias when referencing the assembly so it can be used in the script code to allo mapiing very specific version of teh ref assembly:
var scriptCode = @"
extern alias util_v1;
using Util_1 = util_v1::Util;
using System;
public class Script
{
public string GetGreeting(string name) => new Util_1().GetGreeting(name);
}";
dynamic script = CSScript.Evaluator
.ReferenceAssembly(asmFile, "util_v1")
.LoadCode(scriptCode);
How?
In PrepareRefAssemblies(), will need to replace AddReferences(assembly) path with explicit metadata ref creation:
var mdRef = MetadataReference.CreateFromFile(
assembly.Location(),
new MetadataReferenceProperties().WithAliases(new[] { "util_v1" })
);
CompilerSettings = CompilerSettings.AddReferences(mdRef);
Triggered by #464
What?
It should be possible to specify an alias when referencing the assembly so it can be used in the script code to allo mapiing very specific version of teh ref assembly:
How?
In PrepareRefAssemblies(), will need to replace AddReferences(assembly) path with explicit metadata ref creation: