I'm trying to get a script compiled with Roslyn but whatever I do it keeps complaining about this, at this moment I tried almost everything and have no idea what to try next.
This is the error I get :
'(11,7): error CS0246: The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)'
It is complaining that the namespace can't be found
I already added the references to the file and even added the assemblies to the InteractiveAssemblyLoader but still no luck.
try
{
#if (DEBUG)
var metadataReferences = ApplicationSettings.Instance.GetValuesAsStringList("Script editor", "MetadataReferences_VOP");
#else
var metadataReferences = ApplicationSettings.Instance.GetValuesAsStringList("Script editor", "MetadataReferences");
#endif
var scriptOptions = ScriptOptions.Default.WithEmitDebugInformation(true);
scriptOptions.AddReferences(metadataReferences);
using var assemblyLoader = new InteractiveAssemblyLoader();
foreach(var reference in metadataReferences)
assemblyLoader.RegisterDependency(Assembly.Load(File.ReadAllBytes(reference)));
scriptRunner = CSharpScript
.Create<string>(script, scriptOptions, typeof(MainGlobals), assemblyLoader)
.ContinueWith("new NewEmail().Main(Email)")
.CreateDelegate();
exception = null;
return true;
}
catch (Exception e)
{
exception = e;
scriptRunner = null;
return false;
}
Is there somebody that has an idea about what to try next?