C# 设置断点时Android应用程序启动Mono时出现异常

C# 设置断点时Android应用程序启动Mono时出现异常,c#,android,mono,xamarin.android,visual-studio-2013,C#,Android,Mono,Xamarin.android,Visual Studio 2013,我在VS2013中使用最新的Xamarin版本创建了一个示例Android应用程序 如果我在没有断点的调试模式下运行该应用程序,它可以正常工作,但如果我在其中设置断点,则在启动时崩溃 以下是调试窗口输出 Loaded assembly: AndroidApplication1.dll Loaded assembly: Mono.Android.dll [External] Loaded assembly: System.Core.dll [External] Loaded assembly: M

我在VS2013中使用最新的Xamarin版本创建了一个示例Android应用程序

如果我在没有断点的调试模式下运行该应用程序,它可以正常工作,但如果我在其中设置断点,则在启动时崩溃

以下是调试窗口输出

Loaded assembly: AndroidApplication1.dll
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: MonoDroidConstructors [External]
Mono.Android.VisualStudio.MonoAndroidPackage Error: 0 : MonoAndroidDebuggerSession
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
01-23 20:48:34.024 E/SELinux (11998): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /data/security/spota/seapp_contexts
01-23 20:48:34.029 D/dalvikvm(11998): Late-enabling CheckJNI
01-23 20:48:34.089 D/dalvikvm(11998): Trying to load lib /data/app-lib/AndroidApplication1.AndroidApplication1-1/libmonodroid.so 0x42212b38
01-23 20:48:34.089 D/dalvikvm(11998): Added shared lib /data/app-lib/AndroidApplication1.AndroidApplication1-1/libmonodroid.so 0x42212b38
01-23 20:48:34.094 W/MonoDroid-Debugger(11998): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8965,server=y,embedding=1
01-23 20:48:34.264 W/MonoDroid-Debugger(11998): Accepted stdout connection: 51
01-23 20:48:35.029 W/libc    (11998): WARNING: generic atexit() called from legacy shared library
01-23 20:48:35.039 D/Mono    (11998): Image addref mscorlib[0x751e63f0] -> mscorlib.dll[0x71bce850]: 1
01-23 20:48:35.044 D/Mono    (11998): AOT failed to load AOT module mscorlib.dll.so: dlopen failed: library "/data/data/AndroidApplication1.AndroidApplication1/lib/mscorlib.dll.so" not found
01-23 20:48:35.114 D/Mono    (11998): GC_MAJOR: (mature allocation failure) pause 1.17ms, total 1.17ms, bridge 0.02ms major 112K/32K los 0K/0K
01-23 20:48:35.124 D/Mono    (11998): Assembly mscorlib[0x751e63f0] added to domain RootDomain, ref_count=1
01-23 20:48:37.149 D/Mono    (11998): Image addref AndroidApplication1[0x753db9f0] -> AndroidApplication1.dll[0x753db008]: 1
01-23 20:48:37.149 D/Mono    (11998): Assembly AndroidApplication1[0x753db9f0] added to domain RootDomain, ref_count=1
01-23 20:48:37.149 D/Mono    (11998): AOT failed to load AOT module AndroidApplication1.dll.so: dlopen failed: library "/data/data/AndroidApplication1.AndroidApplication1/lib/AndroidApplication1.dll.so" not found
01-23 20:48:37.149 W/monodroid-gc(11998): GREF GC Threshold: 46800
01-23 20:48:37.154 D/Mono    (11998): Image addref Mono.Android[0x753e0cd0] -> Mono.Android.dll[0x753e02d8]: 1
01-23 20:48:37.154 D/Mono    (11998): Assembly Mono.Android[0x753e0cd0] added to domain RootDomain, ref_count=1
01-23 20:48:37.159 D/Mono    (11998): AOT failed to load AOT module Mono.Android.dll.so: dlopen failed: library "/data/data/AndroidApplication1.AndroidApplication1/lib/Mono.Android.dll.so" not found
01-23 20:48:37.234 W/Mono    (11998): The request to load the assembly mscorlib v2.0.5.0 was remapped to v2.0.0.0
01-23 20:48:37.234 D/Mono    (11998): Unloading image mscorlib.dll [0x753face0].
01-23 20:48:37.234 D/Mono    (11998): Assembly Ref addref Mono.Android[0x753e0cd0] -> mscorlib[0x751e63f0]: 2
01-23 20:48:37.404 W/Mono    (11998): The request to load the assembly System.Core v2.0.5.0 was remapped to v3.5.0.0
01-23 20:48:37.404 D/Mono    (11998): Image addref System.Core[0x791a6e58] -> System.Core.dll[0x791a1e00]: 1
01-23 20:48:37.404 D/Mono    (11998): Assembly System.Core[0x791a6e58] added to domain RootDomain, ref_count=1
01-23 20:48:37.404 D/Mono    (11998): AOT failed to load AOT module System.Core.dll.so: dlopen failed: library "/data/data/AndroidApplication1.AndroidApplication1/lib/System.Core.dll.so" not found
01-23 20:48:37.404 D/Mono    (11998): Assembly Ref addref Mono.Android[0x753e0cd0] -> System.Core[0x791a6e58]: 2
01-23 20:48:37.404 W/Mono    (11998): The request to load the assembly mscorlib v2.0.5.0 was remapped to v2.0.0.0
01-23 20:48:37.404 D/Mono    (11998): Unloading image mscorlib.dll [0x7938fe20].
01-23 20:48:37.404 D/Mono    (11998): Assembly Ref addref System.Core[0x791a6e58] -> mscorlib[0x751e63f0]: 3
01-23 20:48:37.489 D/Mono    (11998): Assembly Ref addref AndroidApplication1[0x753db9f0] -> Mono.Android[0x753e0cd0]: 2
01-23 20:48:38.124 D/Mono    (11998): DllImport attempting to load: '__Internal'.
01-23 20:48:38.124 D/Mono    (11998): DllImport loaded library '(null)'.
01-23 20:48:38.124 D/Mono    (11998): DllImport searching in: '__Internal' ('(null)').
01-23 20:48:38.124 D/Mono    (11998): Searching for '_monodroid_get_identity_hash_code'.
01-23 20:48:38.124 D/Mono    (11998): Probing '_monodroid_get_identity_hash_code'.
01-23 20:48:38.124 D/Mono    (11998): Found as '_monodroid_get_identity_hash_code'.
01-23 20:48:38.544 W/Mono    (11998): The request to load the assembly mscorlib v2.0.5.0 was remapped to v2.0.0.0
01-23 20:48:38.549 D/Mono    (11998): Unloading image mscorlib.dll [0x796ff228].
01-23 20:48:38.549 D/Mono    (11998): Assembly Ref addref AndroidApplication1[0x753db9f0] -> mscorlib[0x751e63f0]: 4
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFullPath(String path)
   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
我花了一整天的时间想弄清楚到底发生了什么事,但毫无结果。非常感谢您的帮助

谢谢


阿尔贝托

我也有同样的问题。解决方案是禁用快速部署。 右键单击项目->属性->Android选项->取消勾选“使用快速部署”


在另一种情况下,我必须选中“除上述内容外,还必须为每个选定的ABI生成一个包(.apk)。

问题仍然存在,但是在没有断点的情况下启动应用程序调试,并在应用程序运行时添加断点似乎是一种可行的方法。沙马林的虫子?