public Form1()
{
String _inputfile = @"C:\Input\cea.tif";
InitializeComponent();
pb_picturebox.SizeMode = PictureBoxSizeMode.StretchImage;
pb_picturebox.ClientSize = new Size(515, 515);
pb_picturebox.Image = null;
pb_picturebox.Image = Image.FromFile(_inputfile);
GeoTiffReader tiff = new GeoTiffReader(_inputfile); // <- IOException was...
IList<IGeometry> result = tiff.ReadToEnd();
tiff.Close();
}
I get an IOException was unhalted error. How should I handle this problem? It works with different file names.
This code sample is cause the exception in GeoTiffReader class:
// open the stream for reading
try
{
_baseStream = FileSystem.GetFileSystemForPath(_path).OpenFile(_path.AbsolutePath, FileMode.Open, FileAccess.Read); // open the file specified by path
}
catch (Exception ex)
{
throw new IOException("Exception occured during stream opening.", ex);
}
Watch: name: ex value: {"The process cannot access the file 'C:\Input\cea.tif' because it is being used by another process."}