I guess this is the problem with the Culture
of your machine as it is set to some other culture
than en-Us
. Because the path values should be comma/space seperated in order to be parsed while in your case ToString()
is returning the semi colon seperated values. Try using CultureInfo.InvariantCulture
while converting the Geometry
to string
. It will fix the exception
string str = geometry.ToString(CultureInfo.InvariantCulture);