Last post Apr 08, 2014 11:42 PM by Pragati Katiyar
Feb 15, 2014 12:51 AM|jnagasuresh|LINK
I am trying to save xml file using string parameter as file path, it is not saying Invalid parameter in my windows8 machine.
Intellegence is listed only 5 overloaded method which does not have a option with string param where MSDN articles are showing that around 7 overloading methods which includes string prameter along with saving options.
Xdocument xdoc = new Xdocument();
xdoc = Xdocument.Load(Path); ---Path has physical file path
.........code logic goes here...
xdoc.Save(Path);----Throwing complie error sayign invalid parameters.....
Note:And I am using .Net portable class library
Any help is well appreciated.
Feb 15, 2014 04:14 AM|Siva Krishna Macha|LINK
Hope the variable 'Path' is of type string.
So, essentially you should have been using the overload method mentioned here:
There is one catch in it - this method seems to be available from .NET framework 3.5, 4 and 4.5 only. So you may need to cross check if your framework version is with in this range.
Hope this helps.
Apr 08, 2014 11:42 PM|Pragati Katiyar|LINK
Check what is there in Path at the time of runtime...copy that value and go to "start", click on Run and paste your copied path....check if it is pointing right location.