Mono.Poxis not foun

StefaanAvonds.3725StefaanAvonds.3725 USMember ✭✭✭

Dear

I have a Xamarin.Forms-application that can compile correctly both on Android and iOS, but during runtime (about 5 seconds after startup) the Android-app throws an exception saying

    EXCEPTION: Mono.Debuggin.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=2.0.0.0, ...
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.Debuggin.Soft.SoftDebuggerSession.EventHandler()
--- End of inner exception stack trace ---

Also debugging in iOS is broken...

What is causing this problem? And more importantly, what's the solution?

Best Answer

Answers

  • StefaanAvonds.3725StefaanAvonds.3725 USMember ✭✭✭

    That did it! I've uninstalled 4.0.0 and installed 2.0.0, now it works again, thanks!

  • Ron999Ron999 USMember ✭✭

    me, too

  • Ron999Ron999 USMember ✭✭

    Thanks Michael for the concise, easy to follow instructions. thanks to you, i was able to fix the error and learned a little bit about GAC.> @MichaelShelestov said:

    It seems it is bug of latest Xamarin:
    https://bugzilla.xamarin.com/show_bug.cgi?id=56787
    Next workaround works for me (Visual Studio 2015 Update 3):
    1) Close Visual Studio
    2) Download mono.posix.4.0.0.nupkg
    https://www.nuget.org/api/v2/package/Mono.Posix/4.0.0
    It is ZIP file - just rename it, unpack and get mono.posix.4.0.0.nupkg\lib\net40\Mono.Posix.dll
    3) Install Mono.Posix.dll to GAC:
    https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx
    If it does not help - try uninstall 4.0.0. from GAC and probably, install 2.0.0 from bugzilla instead.

  • EmreAltanEmreAltan USMember ✭✭

    @MichaelShelestov said:
    It seems it is bug of latest Xamarin:
    https://bugzilla.xamarin.com/show_bug.cgi?id=56787
    Next workaround works for me (Visual Studio 2015 Update 3):
    1) Close Visual Studio
    2) Download mono.posix.4.0.0.nupkg
    https://www.nuget.org/api/v2/package/Mono.Posix/4.0.0
    It is ZIP file - just rename it, unpack and get mono.posix.4.0.0.nupkg\lib\net40\Mono.Posix.dll
    3) Install Mono.Posix.dll to GAC:
    https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx
    If it does not help - try uninstall 4.0.0. from GAC and probably, install 2.0.0 from bugzilla instead.

    Thanks, uninstalling 4.0.0 and installing 2.0.0 has worked like a charm. You saved my day!

  • FelipeSouzaLongoFelipeSouzaLongo USMember ✭✭

    @MichaelShelestov said:
    It seems it is bug of latest Xamarin:
    https://bugzilla.xamarin.com/show_bug.cgi?id=56787
    Next workaround works for me (Visual Studio 2015 Update 3):
    1) Close Visual Studio
    2) Download mono.posix.4.0.0.nupkg
    https://www.nuget.org/api/v2/package/Mono.Posix/4.0.0
    It is ZIP file - just rename it, unpack and get mono.posix.4.0.0.nupkg\lib\net40\Mono.Posix.dll
    3) Install Mono.Posix.dll to GAC:
    https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx
    If it does not help - try uninstall 4.0.0. from GAC and probably, install 2.0.0 from bugzilla instead.

    I want to thank you very much for the solution.
    I had the same problem and these steps was the solution.
    I had do use the 2.0.0 from bugzilla thou, because it was the DLL version it demanded in the Exception.

  • JimTyminskiJimTyminski USUniversity ✭✭

    GAUTIL.EXE worked for me.

  • EricBrunnerEricBrunner USMember ✭✭

    I use VS2017 Enterprise. In my XF project when I launch the Android project in debug mode and hit a breakpoint in the .NET Standard I get that exception. Breakpoints in the MainActivity for instance are hit and I can step through.

    Stacktrace:

    Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
    System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
    at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
    at Mono.Cecil.Metadata.GuidHeap.Read(UInt32 index)
    at Mono.Cecil.MetadataReader.InitializeCustomDebugInformations()
    at Mono.Cecil.MetadataReader.GetCustomDebugInformation(ICustomDebugInformationProvider provider)
    at Mono.Cecil.Cil.PortablePdbReader.Read(MethodDefinition method)
    at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
    at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
    at Mono.Cecil.MethodDefinition.<>c.b__41_0(MethodDefinition method, MetadataReader reader)
    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func3 read) at Mono.Cecil.MethodDefinition.get_Body() at Mono.Cecil.MethodDefinition.get_DebugInformation() at Mono.Debugging.Soft.SoftDebuggerSession.LoadPdbType(TypeDefinition type, Dictionary2 fileToSourceFileInfos)
    at Mono.Debugging.Soft.SoftDebuggerSession.LoadPdbFile(String assemblyFileName, String pdbFileName)
    at Mono.Debugging.Soft.SoftDebuggerSession.LoadDebugFile(String assemblyFileName, String debugFileName, Func`3 loadDebugFile)
    at Mono.Debugging.Soft.SoftDebuggerSession.CheckBetterMatch(TypeMirror type, String file, Int32 line, Int32 column, Location found)
    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()

    Hope you can help me.
    best
    Eric

  • MarketAllyMarketAlly USMember ✭✭

    Thank you for the update - at least 2 hours lost trying to resolve this did not end in defeat.

Sign In or Register to comment.