Blog Hero Image

Xamarin Exception: Could not load file or assembly mono.posix beim Debugging

This article dates back to 2017. Some of the tech in it is history by now; the article stays online as part of my archive.

AI training  ·  Current trainings

Xamarin Exception: Could not load file or assembly mono.posix beim Debugging

Nach einem der letzten Updates zu Visual Studio 2017.2 erhielt ich folgende Fehlermeldung beim Debugging einer Android App:

EXCEPTION: Mono.Debugging.Soft.DisconnectedException: The connection with the debugger has been lost. The target application may have exited. ---> System.IO.FileNotFoundException: Can not load 'Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or its dependencies. File not found.
   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()

Eine Lösung des Problems war glücklicherweise schnell gefunden. Wie man auf der Xamarin Release Seite nachlesen kann, wird die Datei Mono.Posix.dll tatsächlich durch den Visual Studio Installer nicht mit intstalliert.

Bis das Problem mit einem Update behoben ist hilft folgender Workarround, der aus dem obigen Link entnommen wurde:

  • Download der fehlenden Datei Mono.Posix.
  • Entpacken des Archivs
  • In den Eigenschaften der Mono.Posix.dll prüfen ob die Datei durch Xamarin Inc. signiert wurde
  • Datei ggfs. im Tab Allgmemein der Eigenschaften “Entblocken”
  • Unter: Visual Studio 2017: Datei Mono.Posix.dll in das “Xamarin.VisualStudio” Erweiterungs-Verzeichnis kopieren. Bei mir lag das unter: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio
  • Visual Studio beenden und neustarten falls es während des Kopiervorgangs lief.

Das Problem sollte zum Glück nur temporär bestehen, da es im Xamarin Bugzilla bereits auf den Status gelöst gesetzt wurde. Mit Visual Studio 2017.3 sollte sich das Problem also erledigt haben.

Working with .NET MAUI or Xamarin?

In my book on developing cross-platform apps with .NET MAUI (Hanser, 2nd edition) I take you from your first XAML layout all the way to the app stores. And if your whole team needs to get on board or migrate: that is what my .NET MAUI training is for.

I test the AI tools in real projects. You read what matters in five minutes.

What's changed in Claude Code, Copilot, and the other AI tools, and what it means for .NET teams. Plus news on .NET MAUI and the next book edition. No fixed schedule: I write when there's something worth your time. Unsubscribe anytime.

We send via Brevo. By subscribing you agree to your data being processed by Brevo.