Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
string fileName = "tmp";
using (var fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
On .Net the code above throws:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file 'C:\Users\Marcos\Documents\tmp.txt' because it is being used by another process.
On Mono no exception occurs.
This reproduces a failing assert on one of the Roslyn tests.
I don't think this is Mono issue. Windows does not allow you do that but that does not mean other systems have same limitation.
Looking at the windows exception, it does not seem to indicate any .net code is involved
Unhandled Exception: System.IO.IOException: The process cannot access the file 'c:\git\mono\mcs\mcs\tmp' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at ExceptionDispatchInfoRepro.MainClass.Main(String args)