Flee
Flee copied to clipboard
Why doesn't Path.GetFileName() work but GetFileName() works ?
I have a string which says "Path.GetFileName(<path>)
. This throws an exception , whereas when I use "GetFileName(<path>)"
it works. Any idea why ? Am I missing something ?
You have to provide more information.
Hi @eskaufel . I have a string which says "#DECLARE script string = Path.GetFileName(<pathOfFile>)"
. I have created a dictionary in which I want to keep the value of script after solving the RHS.
I am doing this
string value = "Path.GetFileName(<pathOfFile>)"
IDynamicExpression exp = context.CompileDynamic(value);
dValue = exp.Evaluate();
This throws an exception that Path
is not an object .
It works if I change the script to "#DECLARE script string = GetFileName(<pathOfFile>)"
.
How can I make it work with Path.GetFileName
?
Flee expressions don't support namespaces. A name followed by a dot would need to be an object.