The problem is that WPF has a class called System.Windows.Shapes.Path
(representing a drawing path), and you want System.IO.Path
(for working with filesystem paths). Your file already has using System.Windows.Shapes
. Adding using System.IO
won't help because then the compiler won't know which Path
you mean.
You can fix the problem by adding this line at the top of your file, which will tell the compiler that when you say Path
you mean System.IO.Path
.
using Path = System.IO.Path;
(Note: If you do this, you don't need using System.IO
unless you're using other classes from System.IO
.)