Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why doesn't Path.GetFileName() work but GetFileName() works ? #37

Open
varadhbhatnagar opened this issue Jul 21, 2018 · 3 comments
Open

Comments

@varadhbhatnagar
Copy link

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 ?

@eskaufel
Copy link
Contributor

You have to provide more information.

@varadhbhatnagar
Copy link
Author

varadhbhatnagar commented Jul 22, 2018

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 ?

@hunkydoryrepair
Copy link
Contributor

Flee expressions don't support namespaces. A name followed by a dot would need to be an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants