error CS0246: The type or namespace name 'DateTime' could not be found (are you missing a using directive or an assembly reference?)
When running the following code:
public string DateCalculationString
{
get => _dateCalculationString;
set
{
var options = ScriptOptions.Default.AddReferences(typeof(DateTime).Assembly);
**var task = CSharpScript.EvaluateAsync<Func<string, DateTime>>(value, options);**
DateCalculation = task.GetAwaiter().GetResult();
_dateCalculationString = value;
}
}
It appears I am adding the reference incorrectly. Can someone point me in the right direction?
Apparently I needed a reference and an import: