Somewhy you have imported (used) namespace “System.Windows.Shape” that actually have Path class as well as “
System.IO” namespace have it.
So .NET have a conflict and can’t understand which “Path” do you want to use.
Solutions:
1) Find what kind of activity adds “System.Windows.Shape” and remove it, or, if you can’t do that:
2) Use fully qualified name of the class (it inludes namespace), so finaly you will have:
System.IOSystem.IO.Path.GetFileNameWithoutExtension(...) +
System.IOSystem.IO.Path.GetExtension(...)