次のコードがあります。
Bitmap image = new Bitmap(filePath);
...
image.Save(someOtherPath);
image.Dispose();
File.Delete(filePath);
File.Move(someOtherPath, filePath);
File.Delete 行で次のエラーが発生します。
The process cannot access the file '...' because it is being used by another process.
C# でファイルのロックを解除するにはどうすればよいですか?