Bug 8547 - monodroid.log sharing violation
Summary: monodroid.log sharing violation
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.0
Hardware: PC Windows
: Normal normal
Target Milestone: 4.0.2 (C6SR2)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-21 13:23 UTC by Goncalo Oliveira
Modified: 2016-03-04 21:19 UTC (History)
7 users (show)

Tags: _XVSC6SR2
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 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.

Related Links:
Status:
VERIFIED FIXED

Description Goncalo Oliveira 2012-11-21 13:23:48 UTC
When more than one instance of VS is opened (VS 2012) a sharing violation exception for monodroid.log is thrown.
I also believe this is responsible for some VS freezes, though I can't replicate that consistently.
Comment 1 Goncalo Oliveira 2012-12-13 11:05:04 UTC
Can't replicate since 4.4.41
Comment 2 Goncalo Oliveira 2012-12-13 11:30:28 UTC
Actually... reopening. :(


System.AggregateException: One or more errors occurred. ---> System.IO.IOException: The process cannot access the file 'C:\Users\goliveira\Desktop\monodroid.log' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append)
   at Mono.VisualStudio.Extension.FileLogger.Log(LogLevel level, String message)
   at Mono.VisualStudio.Extension.LoggingService.Log(LogLevel level, String message)
   at Mono.Android.VisualStudio.MonoAndroidPackage.<Initialize>b__3(String task, String message)
   at Mono.AndroidTools.AndroidLogger.LogDebug(String task, String format, Object[] args)
   at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.IO.IOException: The process cannot access the file 'C:\Users\goliveira\Desktop\monodroid.log' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append)
   at Mono.VisualStudio.Extension.FileLogger.Log(LogLevel level, String message)
   at Mono.VisualStudio.Extension.LoggingService.Log(LogLevel level, String message)
   at Mono.Android.VisualStudio.MonoAndroidPackage.<Initialize>b__3(String task, String message)
   at Mono.AndroidTools.AndroidLogger.LogDebug(String task, String format, Object[] args)
   at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)<---


This causes at least one of the Visual Studio instances to freeze.