I am writing a simple console application that will read xml from a test file and deserialize it to an object.
var s = File.ReadAllBytes("G:\\Temp\\Publishing\\2.txt");
Stream _response = File.OpenRead("G:\\Temp\\Publishing\\2.txt");
var s = File.ReadAllBytes(@"g:\temp\publishing\2.txt");
var s = File.ReadAllBytes(@"G:\Temp\Publishing\2.txt");
I have tried all of the above to read the file and it always throws NotSupportedException
with a message
The given path's format is not supported.
What is the format-error in the above path?
According to the reference source: http://referencesource.microsoft.com/#mscorlib/system/io/filestream.cs#732
NotSupportedException
will be thrown if the index of the :
in your path is at the third position or later. (One would expect :
to be the second character) Are you sure there are no zero-width combining characters or other similar Unicode shenanigans going on in your source?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With