gpt4 book ai didi

c# - 对于 .NETFramework 4.5.1,使用 Mono 运行的 dotnet 失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:24:38 27 4
gpt4 key购买 nike

我正在尝试使用 .NETFramework,Version=v4.5.1 (net451) 在 Linux 上运行我的 WebApi 应用程序。当我使用 yeoman 创建 WebApi 项目时,基本示例运行良好。但是,我使用 .NETFramework 4.5.1 的更大项目在实际运行时失败了。

我使用的 Mono 版本在 OSX 和 Linux (Ubuntu Server 14.04 LTS) 上都是 4.2.3。接下来我可能会尝试去一个不稳定的 channel ,但我希望我不必这样做,并且有一些方法我可以失去似乎导致这个的 System.Diagnostics 依赖项(虽然我不要直接把那个包裹带进来)。

当我使用我之前使用的 dnx451 时,我没有遇到这个问题。我一直在尝试改用新工具,这就是我最初走这条路的原因。

$ dotnet run
Project MyProject.Models (.NETFramework,Version=v4.5.1) was previously compiled. Skipping compilation.
Project MyProject.Api (.NETFramework,Version=v4.5.1) was previously compiled. Skipping compilation.
Stacktrace:
* Assertion at metadata.c:1017, condition `idx >= 0' not met
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Diagnostics.StackTrace.get_trace (System.Exception,int,bool) <IL 0x0000f, 0xffffffff>
at System.Diagnostics.StackTrace..ctor (System.Exception,int,bool) [0x0002e] in /private/tmp/mono20160330-58397-jmwbb9/mono-4.2.3/mcs/class/corlib/System.Diagnostics/StackTrace.cs:129
at System.Exception.get_StackTrace () [0x0001f] in /private/tmp/mono20160330-58397-jmwbb9/mono-4.2.3/mcs/class/corlib/System/Exception.cs:202
at System.Exception.ToString () [0x0007f] in /private/tmp/mono20160330-58397-jmwbb9/mono-4.2.3/mcs/class/corlib/System/Exception.cs:276
at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <IL 0x00058, 0xffffffff>
Native stacktrace:
0 mono 0x0000000103463975 mono_handle_native_sigsegv + 271
1 libsystem_platform.dylib 0x00007fff8cc2552a _sigtramp + 26
2 ??? 0x0000000000000003 0x0 + 3
3 libsystem_c.dylib 0x00007fff915ac6e7 abort + 129
4 mono 0x00000001035c79be monoeg_g_log + 0
5 mono 0x00000001035c7943 monoeg_g_logv + 83
6 mono 0x00000001035c7ae8 monoeg_assertion_message + 143
7 mono 0x0000000103509ab6 mono_metadata_decode_row + 233
8 mono 0x00000001034d881d get_docinfo + 61
9 mono 0x00000001034d832a mono_ppdb_lookup_location + 155
10 mono 0x000000010352047e mono_debug_lookup_source_location + 130
11 mono 0x00000001034611a1 ves_icall_get_trace + 482
12 ??? 0x00000001077f30e5 0x0 + 4420743397
13 mono 0x00000001033d68ca mono_jit_runtime_invoke + 1463
14 mono 0x0000000103553c97 mono_runtime_invoke + 110
15 mono 0x0000000103558e63 mono_print_unhandled_exception + 176
16 mono 0x0000000103462be3 mono_handle_exception_internal + 3312
17 mono 0x0000000103461eef mono_handle_exception + 24
18 mono 0x00000001034b1267 mono_amd64_throw_exception + 113
19 ??? 0x0000000103987607 0x0 + 4355290631
20 ??? 0x0000000103be8f33 0x0 + 4357787443
21 mono 0x00000001033d68ca mono_jit_runtime_invoke + 1463
22 mono 0x0000000103553c97 mono_runtime_invoke + 110
23 mono 0x0000000103558915 mono_runtime_exec_main + 379
24 mono 0x0000000103439800 mono_main + 6785
25 libdyld.dylib 0x00007fff98ec15ad start + 1
Debug info from gdb:
(lldb) command source -s 0 '/tmp/mono-gdb-commands.6WMaVv'
Executing commands in '/tmp/mono-gdb-commands.6WMaVv'.
(lldb) process attach --pid 24146
Process 24146 stopped
* thread #1: tid = 0x45e53, 0x00007fff8ba79582 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff8ba79582 libsystem_kernel.dylib`__wait4 + 10
libsystem_kernel.dylib`__wait4:
-> 0x7fff8ba79582 <+10>: jae 0x7fff8ba7958c ; <+20>
0x7fff8ba79584 <+12>: movq %rax, %rdi
0x7fff8ba79587 <+15>: jmp 0x7fff8ba737f2 ; cerror
0x7fff8ba7958c <+20>: retq
Executable module set to "/usr/local/bin/mono".
Architecture set to: x86_64h-apple-macosx.
(lldb) thread list
Process 24146 stopped
* thread #1: tid = 0x45e53, 0x00007fff8ba79582 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
thread #2: tid = 0x45e55, 0x00007fff8ba78db6 libsystem_kernel.dylib`__psynch_cvwait + 10
thread #3: tid = 0x45e56, 0x00007fff8ba72fae libsystem_kernel.dylib`semaphore_wait_trap + 10
thread #4: tid = 0x45e57, 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
thread #5: tid = 0x45e58, 0x00007fff8ba79efa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
thread #6: tid = 0x45e59, 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
(lldb) thread backtrace all
* thread #1: tid = 0x45e53, 0x00007fff8ba79582 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x00007fff8ba79582 libsystem_kernel.dylib`__wait4 + 10
frame #1: 0x0000000103463a0b mono`mono_handle_native_sigsegv + 421
frame #2: 0x00007fff8cc2552a libsystem_platform.dylib`_sigtramp + 26
frame #3: 0x00007fff8ba78f07 libsystem_kernel.dylib`__pthread_kill + 11
frame #4: 0x00007fff93e784ec libsystem_pthread.dylib`pthread_kill + 90
frame #5: 0x00007fff915ac6e7 libsystem_c.dylib`abort + 129
frame #6: 0x00000001035c79be mono`monoeg_log_default_handler + 105
frame #7: 0x00000001035c7943 mono`monoeg_g_logv + 83
frame #8: 0x00000001035c7ae8 mono`monoeg_assertion_message + 143
frame #9: 0x0000000103509ab6 mono`mono_metadata_decode_row + 233
frame #10: 0x00000001034d881d mono`get_docinfo + 61
frame #11: 0x00000001034d832a mono`mono_ppdb_lookup_location + 155
frame #12: 0x000000010352047e mono`mono_debug_lookup_source_location + 130
frame #13: 0x00000001034611a1 mono`ves_icall_get_trace + 482
frame #14: 0x00000001077f30e5
frame #15: 0x00000001033d68ca mono`mono_jit_runtime_invoke + 1463
frame #16: 0x0000000103553c97 mono`mono_runtime_invoke + 110
frame #17: 0x0000000103558e63 mono`mono_print_unhandled_exception + 176
frame #18: 0x0000000103462be3 mono`mono_handle_exception_internal + 3312
frame #19: 0x0000000103461eef mono`mono_handle_exception + 24
frame #20: 0x00000001034b1267 mono`mono_amd64_throw_exception + 113
frame #21: 0x0000000103987607
frame #22: 0x0000000103be8f33
frame #23: 0x00000001033d68ca mono`mono_jit_runtime_invoke + 1463
frame #24: 0x0000000103553c97 mono`mono_runtime_invoke + 110
frame #25: 0x0000000103558915 mono`mono_runtime_exec_main + 379
frame #26: 0x0000000103439800 mono`mono_main + 6785
frame #27: 0x00007fff98ec15ad libdyld.dylib`start + 1
frame #28: 0x00007fff98ec15ad libdyld.dylib`start + 1
thread #2: tid = 0x45e55, 0x00007fff8ba78db6 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #0: 0x00007fff8ba78db6 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x00007fff93e76728 libsystem_pthread.dylib`_pthread_cond_wait + 767
frame #2: 0x000000010359e811 mono`thread_func + 273
frame #3: 0x00007fff93e7599d libsystem_pthread.dylib`_pthread_body + 131
frame #4: 0x00007fff93e7591a libsystem_pthread.dylib`_pthread_start + 168
frame #5: 0x00007fff93e73351 libsystem_pthread.dylib`thread_start + 13
thread #3: tid = 0x45e56, 0x00007fff8ba72fae libsystem_kernel.dylib`semaphore_wait_trap + 10
frame #0: 0x00007fff8ba72fae libsystem_kernel.dylib`semaphore_wait_trap + 10
frame #1: 0x00000001035bb3dc mono`mono_sem_wait + 29
frame #2: 0x0000000103551fa4 mono`finalizer_thread + 124
frame #3: 0x0000000103533ed1 mono`start_wrapper + 410
frame #4: 0x00000001035c1bf9 mono`inner_start_thread + 197
frame #5: 0x00007fff93e7599d libsystem_pthread.dylib`_pthread_body + 131
frame #6: 0x00007fff93e7591a libsystem_pthread.dylib`_pthread_start + 168
frame #7: 0x00007fff93e73351 libsystem_pthread.dylib`thread_start + 13
thread #4: tid = 0x45e57, 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff93e75578 libsystem_pthread.dylib`_pthread_wqthread + 1283
frame #2: 0x00007fff93e73341 libsystem_pthread.dylib`start_wqthread + 13
thread #5: tid = 0x45e58, 0x00007fff8ba79efa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
frame #0: 0x00007fff8ba79efa libsystem_kernel.dylib`kevent_qos + 10
frame #1: 0x00007fff8cace165 libdispatch.dylib`_dispatch_mgr_invoke + 216
frame #2: 0x00007fff8cacddcd libdispatch.dylib`_dispatch_mgr_thread + 52
thread #6: tid = 0x45e59, 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x00007fff8ba795e2 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff93e75578 libsystem_pthread.dylib`_pthread_wqthread + 1283
frame #2: 0x00007fff93e73341 libsystem_pthread.dylib`start_wqthread + 13
(lldb) detach
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Process 24146 detached
(lldb) quit

最佳答案

这似乎是 Mono 中的一个错误 - here是一个恰好包含解决方法的错误报告

关于c# - 对于 .NETFramework 4.5.1,使用 Mono 运行的 dotnet 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37404224/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com