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
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.
Created attachment 22569 [details]
Example scenario for error from Bug 56787 "Could not load file or assembly 'Mono.Posix, Version=22.214.171.124, ...'" when attempting to start debugging with breakpoints set
## Regression status: regression in XamarinVS 126.96.36.1996 (1be4f0c) compared to XamarinVS 188.8.131.523 (c871575)
BAD: XamarinVS 184.108.40.2066 (1be4f0c) "15.2.2 release"
BAD: XamarinVS 220.127.116.115 (3c254b0) [*]
GOOD: XamarinVS 18.104.22.1681 (ff04dcc) [*]
GOOD: XamarinVS 22.214.171.1243 (c871575) "15.2 release"
[*] Un-published development builds, tested using the Visual Studio 2015 Update 3 .msi installation workflow for the closest similarity to end-user installation scenarios.
## Steps followed to test
1. Start with a clean Windows 10 image with a fresh installation of Visual Studio 2017 version 15.2 (26430.12) and the "Mobile development with .NET" workload. (It probably isn't strictly required for the Windows image to be brand new for these steps to work.)
2. Unzip the attached test case. For my tests, I unzipped the project into C:\source.
3. Open the attached test case in Visual Studio. Be sure _not_ to delete the hidden .vs directory. This particular test scenario depends on the fact that the breakpoint currently set in MyClass.cs, line 10 does _not_ match the path of the file on disk .
4. Start debugging the Android app project in the "Debug|Any CPU" configuration on device or emulator.
 An alternative is to delete .vs directory, add a new breakpoint, quit Visual Studio, rename the top-level solution directory, and then reopen the solution.
## BAD Results with Xamarin.VisualStudio 126.96.36.1996 (1be4f0c)
The application begins to run successfully, but then the app exits and an error message appears. The logs indicate that this happens before the breakpoint is resolved.
- An error dialog appears in Visual Studio that shows an error message about the missing Mono.Posix assembly on the development computer:
> EXCEPTION: Mono.Debugging.Soft.DisconnectedException: The connection with the debugger has been lost. The target application may have exited. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Posix, Version=188.8.131.52, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
> at Mono.Debugging.Soft.SoftDebuggerSession.ResolveSymbolicLink(String path)
> at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
> at Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByMethod(MethodMirror method, String file, Int32 line, Int32 column, Boolean& insideTypeRange)
> at Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
> at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
> at Mono.Debugging.Soft.SoftDebuggerSession.HandleTypeLoadEvents(TypeLoadEvent events)
> at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
> at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
- The "View > Output > Debug" window shows the same exception message plus one additional preceding message:
> The connection with the debugger has been lost. The target application
> may have exited.
- The Assembly Binding Log (`fuslogvw`) collected using the steps from Bug 56839, Comment 10 shows that devenv.exe searches several locations but is unable to locate Mono.Posix.dll (see attached `fuslogvw` log file).
## GOOD Results with Xamarin.VisualStudio 184.108.40.2063
The app launches successfully, and then the debugger breaks on the breakpoint.
## Testing environment info (brief)
Microsoft Visual Studio Enterprise 2017
Version 15.2 (26430.12) Release
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Java JDK 8u131 (1.8.0_131) 64-bit
Android SDK Tools 25.2.5
Android SDK Platform-tools 25.0.3
Android SDK Build-tools 23.0.3
Android 7.1.1 (API 25) SDK Platform rev. 3
Windows 10 version 1703 (OS Build 15063.296)
US English locale, US Eastern time zone
### Devices tested
Google API 23 (x86) emulator
Moto G3 API 23 device
Created attachment 22570 [details]
Example assembly binding log (from `fuslogvw`)
Created attachment 22571 [details]
Mono.Posix.dll file for temporary workaround
## Possible temporary workaround
(This workaround was effective in my local testing for the precise scenario described in Comment 0, but as hinted at in Bug 56787, Comment 29, there might also be some other different scenarios that can cause this issue that will not be resolved by this workaround.)
1. Download the attached Mono.Posix.dll file. (This files is signed with a Xamarin code signature.)
2a. For Visual Studio 2017, copy the file into the "Xamarin.VisualStudio" extension directory. For a default installation of the Enterprise edition this will be:
> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio
2b. For Visual Studio 2015, copy the file into the "Xamarin\Xamarin" extension directory:
> C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\
*** This bug has been marked as a duplicate of bug 56787 ***