使用单一服务在Linux上测试Windows DOTNET服务

时间:2013-09-04 16:37:14

标签: c# linux .net-4.0 mono mono-service

我正在尝试使用单一服务在Linux上运行Windows .NET-4.0服务。它不是用单声道或任何东西编译的。我不是100%它可行,但我想我可以尝试(二进制兼容等,似乎doable?)。如我错了请纠正我。

我遇到错误,无法找到一些dll。他们在系统中,但它没有找到它们。这是一个。

$ ldconfig -p | grep Posix
    libMonoPosixHelper.so (libc6,x86-64) => /usr/lib/libMonoPosixHelper.so

我尝试添加路径等但没有变化。

$ MONO_LOG_LEVEL=debug mono-service MyService.exe --debug > output.log

$ MONO_PATH=/usr/lib MONO_LOG_LEVEL=debug mono-service MyService.exe --debug > output.log

或LD_LIBRARY_PATH,这是空的,所以我试过

export LD_LIBRARY_PATH=/usr/lib

在输出中总是这样:

Mono: DllImport attempting to load: 'libMonoPosixHelper.so'.
Mono: DllImport loading library: '/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so'.
Mono: DllImport error loading library '/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so: cannot open shared object file: No such file or directory'.
Mono: DllImport loading library: '/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so'.
Mono: DllImport error loading library '/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so: cannot open shared object file: No such file or directory'.
Mono: DllImport loading location: 'libMonoPosixHelper.so'.

所以它没有在基本路径中找到它,只是查看GAC。它为什么不在那里?应该在GAC之前查看MONO_PATH?我错过了什么吗?

在两个虚拟机上测试:Ubuntu 13.04和一个干净的实时Mint 14。

编辑,添加信息9/10:

好的,Ubuntu的版本是2.10或者其他东西,我试过最新的源代码

$ sudo ./autogen.sh --prefix=/usr/local
$ sudo make
$ sudo make install
$ mono --version
Mono JIT compiler version 3.2.1 (tarball Tue Sep 10 12:25:30 CEST 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen
$ LD_LIBRARY_PATH=/usr/local/lib MONO_LOG_LEVEL=info mono-service MyService.exe --debug > output.log    

output.log:

Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/mscorlib.dll'.
Mono: Image addref mscorlib[0xdb0130] -> /usr/local/lib/mono/4.5/mscorlib.dll[0xdaf370]: 2
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/mscorlib.dll'.
Mono: AOT loaded AOT Module for /usr/local/lib/mono/4.5/mscorlib.dll.

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/4.5/mscorlib.dll'.
Mono: Config attempting to parse: '/usr/local/lib/mono/4.5/mscorlib.dll.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/mscorlib/mscorlib.config'.
Mono: GC_MAJOR: (mature allocation failure) pause 0.16ms, total 0.16ms, bridge 0.00 major 96K/32K los 0K/0K
Mono: Assembly mscorlib[0xdb0130] added to domain mono-service.exe, ref_count=1
Mono: Config attempting to parse: '/usr/local/etc/mono/config'.
Mono: Config attempting to parse: '/home/ejpb/.mono/config'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/mono-service.exe'.
Mono: Image addref mono-service[0xdf0660] -> /usr/local/lib/mono/4.5/mono-service.exe[0xdae210]: 3
Mono: Assembly mono-service[0xdf0660] added to domain mono-service.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/4.5/mono-service.exe.so: /usr/local/lib/mono/4.5/mono-service.exe.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/4.5/mono-service.exe'.
Mono: Config attempting to parse: '/usr/local/lib/mono/4.5/mono-service.exe.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/mono-service/mono-service.config'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/mono-service.exe'.
Mono: AOT failed to load AOT module /usr/local/lib/mono/4.5/mono-service.exe.so: /usr/local/lib/mono/4.5/mono-service.exe.so: cannot open shared object file: No such file or directory

Mono: Assembly Ref addref mono-service[0xdf0660] -> mscorlib[0xdb0130]: 2
Mono: Config attempting to parse: '/usr/local/lib/mono/4.5/mono-service.exe.config'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/Mono.Posix.dll'.
Mono: Image addref Mono.Posix[0xe0bba0] -> /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll[0xe0ae00]: 2
Mono: Assembly Mono.Posix[0xe0bba0] added to domain mono-service.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/4.5/Mono.Posix.dll'.
Mono: Config attempting to parse: '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/Mono.Posix/Mono.Posix.config'.
Mono: Assembly Ref addref mono-service[0xdf0660] -> Mono.Posix[0xe0bba0]: 2
Mono: Assembly Ref addref Mono.Posix[0xe0bba0] -> mscorlib[0xdb0130]: 3
Mono: DllImport attempting to load: 'libc.so.6'.
Mono: DllImport error loading library '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libc.so.6': '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libc.so.6: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libc.so.6.so': '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libc.so.6.so: cannot open shared object file: No such file or directory'.
Mono: DllImport loaded library 'libc.so.6'.
Mono: DllImport searching in: 'libc.so.6' ('libc.so.6').
Mono: Searching for 'chdir'.
Mono: Probing 'chdir'.
Mono: Found as 'chdir'.
Mono: DllImport attempting to load: 'libMonoPosixHelper.so'.
Mono: DllImport error loading library '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so': '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so: cannot open shared object file: No such file or directory'.
Mono: DllImport error loading library '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so': '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/libMonoPosixHelper.so: cannot open shared object file: No such file or directory'.
Mono: DllImport loaded library 'libMonoPosixHelper.so'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_open_mode'.
Mono: Probing 'Mono_Posix_Syscall_open_mode'.
Mono: Found as 'Mono_Posix_Syscall_open_mode'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_lockf'.
Mono: Probing 'Mono_Posix_Syscall_lockf'.
Mono: Found as 'Mono_Posix_Syscall_lockf'.
Mono: DllImport searching in: 'libc.so.6' ('libc.so.6').
Mono: Searching for 'getpid'.
Mono: Probing 'getpid'.
Mono: Found as 'getpid'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_write'.
Mono: Probing 'Mono_Posix_Syscall_write'.
Mono: Found as 'Mono_Posix_Syscall_write'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_get_at_fdcwd'.
Mono: Probing 'Mono_Posix_Syscall_get_at_fdcwd'.
Mono: Found as 'Mono_Posix_Syscall_get_at_fdcwd'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_L_ctermid'.
Mono: Probing 'Mono_Posix_Syscall_L_ctermid'.
Mono: Found as 'Mono_Posix_Syscall_L_ctermid'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_L_cuserid'.
Mono: Probing 'Mono_Posix_Syscall_L_cuserid'.
Mono: Found as 'Mono_Posix_Syscall_L_cuserid'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_get_utime_now'.
Mono: Probing 'Mono_Posix_Syscall_get_utime_now'.
Mono: Found as 'Mono_Posix_Syscall_get_utime_now'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_get_utime_omit'.
Mono: Probing 'Mono_Posix_Syscall_get_utime_omit'.
Mono: Found as 'Mono_Posix_Syscall_get_utime_omit'.
Mono: DllImport searching in: 'libc.so.6' ('libc.so.6').
Mono: Searching for 'free'.
Mono: Probing 'free'.
Mono: Found as 'free'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_malloc'.
Mono: Probing 'Mono_Posix_Stdlib_malloc'.
Mono: Found as 'Mono_Posix_Stdlib_malloc'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_SIG_DFL'.
Mono: Probing 'Mono_Posix_Stdlib_SIG_DFL'.
Mono: Found as 'Mono_Posix_Stdlib_SIG_DFL'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_SIG_ERR'.
Mono: Probing 'Mono_Posix_Stdlib_SIG_ERR'.
Mono: Found as 'Mono_Posix_Stdlib_SIG_ERR'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_SIG_IGN'.
Mono: Probing 'Mono_Posix_Stdlib_SIG_IGN'.
Mono: Found as 'Mono_Posix_Stdlib_SIG_IGN'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib__IOFBF'.
Mono: Probing 'Mono_Posix_Stdlib__IOFBF'.
Mono: Found as 'Mono_Posix_Stdlib__IOFBF'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib__IOLBF'.
Mono: Probing 'Mono_Posix_Stdlib__IOLBF'.
Mono: Found as 'Mono_Posix_Stdlib__IOLBF'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib__IONBF'.
Mono: Probing 'Mono_Posix_Stdlib__IONBF'.
Mono: Found as 'Mono_Posix_Stdlib__IONBF'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_BUFSIZ'.
Mono: Probing 'Mono_Posix_Stdlib_BUFSIZ'.
Mono: Found as 'Mono_Posix_Stdlib_BUFSIZ'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_EOF'.
Mono: Probing 'Mono_Posix_Stdlib_EOF'.
Mono: Found as 'Mono_Posix_Stdlib_EOF'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_FOPEN_MAX'.
Mono: Probing 'Mono_Posix_Stdlib_FOPEN_MAX'.
Mono: Found as 'Mono_Posix_Stdlib_FOPEN_MAX'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_FILENAME_MAX'.
Mono: Probing 'Mono_Posix_Stdlib_FILENAME_MAX'.
Mono: Found as 'Mono_Posix_Stdlib_FILENAME_MAX'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_L_tmpnam'.
Mono: Probing 'Mono_Posix_Stdlib_L_tmpnam'.
Mono: Found as 'Mono_Posix_Stdlib_L_tmpnam'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_stderr'.
Mono: Probing 'Mono_Posix_Stdlib_stderr'.
Mono: Found as 'Mono_Posix_Stdlib_stderr'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_stdin'.
Mono: Probing 'Mono_Posix_Stdlib_stdin'.
Mono: Found as 'Mono_Posix_Stdlib_stdin'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_stdout'.
Mono: Probing 'Mono_Posix_Stdlib_stdout'.
Mono: Found as 'Mono_Posix_Stdlib_stdout'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_TMP_MAX'.
Mono: Probing 'Mono_Posix_Stdlib_TMP_MAX'.
Mono: Found as 'Mono_Posix_Stdlib_TMP_MAX'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_EXIT_FAILURE'.
Mono: Probing 'Mono_Posix_Stdlib_EXIT_FAILURE'.
Mono: Found as 'Mono_Posix_Stdlib_EXIT_FAILURE'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_EXIT_SUCCESS'.
Mono: Probing 'Mono_Posix_Stdlib_EXIT_SUCCESS'.
Mono: Found as 'Mono_Posix_Stdlib_EXIT_SUCCESS'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_MB_CUR_MAX'.
Mono: Probing 'Mono_Posix_Stdlib_MB_CUR_MAX'.
Mono: Found as 'Mono_Posix_Stdlib_MB_CUR_MAX'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Stdlib_RAND_MAX'.
Mono: Probing 'Mono_Posix_Stdlib_RAND_MAX'.
Mono: Found as 'Mono_Posix_Stdlib_RAND_MAX'.
Mono: Assembly mscorlib[0xdb0130] added to domain MyService.exe, ref_count=4
Mono: Config attempting to parse: '/home/ejpb/mono-3.2.1/MyService.exe.config'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll'.
Mono: Image addref Mono.Security[0xf159c0] -> /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll[0xf296f0]: 2
Mono: Assembly Mono.Security[0xf159c0] added to domain MyService.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so: /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll'.
Mono: Config attempting to parse: '/usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/Mono.Security/Mono.Security.config'.
Mono: Assembly Ref addref Mono.Security[0xf159c0] -> mscorlib[0xdb0130]: 5
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/Mono.Security.dll'.
Mono: Unloading image /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll [0x1003f10].
Mono: Assembly Mono.Security[0xf159c0] added to domain mono-service.exe, ref_count=2
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so: /usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.dll'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono-service.dll'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/4.5/Facades/mono-service.dll'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe'.
Mono: Image addref mono-service[0x109a0b0] -> /usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe[0x106e200]: 2
Mono: Assembly mono-service[0x109a0b0] added to domain MyService.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe.so: /usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe'.
Mono: Config attempting to parse: '/usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/mono-service/mono-service.config'.
Mono: Assembly Ref addref mono-service[0x109a0b0] -> mscorlib[0xdb0130]: 6
Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll'.
Mono: Image addref System.ServiceProcess[0x10bf5f0] -> /usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll[0x10be7a0]: 2
Mono: Assembly System.ServiceProcess[0x10bf5f0] added to domain MyService.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll.so: /usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll'.
Mono: Config attempting to parse: '/usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/System.ServiceProcess/System.ServiceProcess.config'.
Mono: Assembly Ref addref mono-service[0x109a0b0] -> System.ServiceProcess[0x10bf5f0]: 2
Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll'.
Mono: Image addref System[0x10c0fc0] -> /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll[0x10c0290]: 2
Mono: Assembly System[0x10c0fc0] added to domain MyService.exe, ref_count=1
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so: /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Loader loaded assembly from location: '/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll'.
Mono: Config attempting to parse: '/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.config'.
Mono: Config attempting to parse: '/usr/local/etc/mono/assemblies/System/System.config'.
Mono: Assembly Ref addref System.ServiceProcess[0x10bf5f0] -> System[0x10c0fc0]: 2
Mono: Assembly Ref addref System[0x10c0fc0] -> mscorlib[0xdb0130]: 7
Mono: Assembly Ref addref System.ServiceProcess[0x10bf5f0] -> mscorlib[0xdb0130]: 8
Mono: Assembly Loader probing location: 'MyService.exe'.
Mono: Assembly Loader probing location: '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll'.
Mono: Assembly Mono.Posix[0xe0bba0] added to domain MyService.exe, ref_count=3
Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: cannot open shared object file: No such file or directory

Mono: Assembly Ref addref mono-service[0x109a0b0] -> Mono.Posix[0xe0bba0]: 4
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_Syscall_syslog'.
Mono: Probing 'Mono_Posix_Syscall_syslog'.
Mono: Found as 'Mono_Posix_Syscall_syslog'.
Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').
Mono: Searching for 'Mono_Posix_FromSyslogLevel'.
Mono: Probing 'Mono_Posix_FromSyslogLevel'.
Mono: Found as 'Mono_Posix_FromSyslogLevel'.
Mono: GC_MAJOR: (user request) pause 1.18ms, total 1.20ms, bridge 0.00 major 704K/272K los 50K/120K
Mono: Unloading domain mono-service.exe[0xdaafb0], assembly __MetadataTypes[0x1025240], ref_count=1
Mono: Unloading assembly __MetadataTypes [0x1025240].
Mono: Unloading image __MetadataTypes [0x1003fc0].
Mono: Unloading image __MetadataTypes [0x102dba0].
Mono: Unloading domain mono-service.exe[0xdaafb0], assembly mscorlib[0xdb0130], ref_count=8
Mono: Unloading domain mono-service.exe[0xdaafb0], assembly mono-service[0xdf0660], ref_count=1
Mono: Unloading assembly mono-service [0xdf0660].
Mono: Unloading domain mono-service.exe[0xdaafb0], assembly Mono.Posix[0xe0bba0], ref_count=4
Mono: Unloading domain mono-service.exe[0xdaafb0], assembly Mono.Security[0xf159c0], ref_count=2
Mono: Unloading image /usr/local/lib/mono/4.5/mono-service.exe [0xdae210].
Mono: Assembly image '/usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/4.5/mscorlib.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/4.5/mscorlib.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/mono-service/4.0.0.0__0738eb9f132ed756/mono-service.exe' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll' still loaded at shutdown.
Mono: Assembly image '/usr/local/lib/mono/gac/System.ServiceProcess/4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll' still loaded at shutdown.

似乎更好,但它仍在关闭。

找到libMonoPosixHelper
    Mono: DllImport loaded library 'libMonoPosixHelper.so'.
但Posix失败了:
    Mono: AOT failed to load AOT module /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: /usr/local/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll.so: cannot open shared object file: No such file or directory
在日志的末尾。这是导致关机的主要错误吗? 早先加载了Mono.Posix.dll ...我不知道在阅读日志时是否遗漏了什么。

编辑9/30

好的,我尝试使用CrunchBang vm,它没有Mono。安装了tarball,带有前缀/ home / ejpb / mono(所需空间,on / home分区) 问题:我是否正确地做到了?我已经从Windows上安装的目录中复制了exe和dll。我可以以某种方式在Linux中使用msi文件(从中提取它们)吗?这会改变什么吗? 我跑了

LD_LIBRARY_PATH=/home/ejpb/mono/lib MONO_LOG_LEVEL=debug mono-service -v /home/ejpb/MyService/MyService.exe --debug > out.log 

进入了.log:

Mono: DllImport searching in: 'libMonoPosixHelper.so' ('libMonoPosixHelper.so').  
Mono: Searching for 'Mono_Posix_Stdlib_RAND_MAX'.  
Mono: Probing 'Mono_Posix_Stdlib_RAND_MAX'.  
Mono: Found as 'Mono_Posix_Stdlib_RAND_MAX'.  

等,所以现在这部分看起来还不错。

我也有不少“未找到”
    单声道:未找到:System.Security.Cryptography.RNGCryptoServiceProvider:RngClose(intptr)。
    单声道:AOT NOT FOUND:System.Threading.InternalThread:Thread_free_internal(intptr)。
等。

我试过MoMA - Mono 2.8(4.0 Profile)。这对3.2.3也是准确的吗?
我得到了:

Assembly                  Version    Missing  Not Implemented  Todo  P/Invoke  
Apache.NMS.ActiveMQ.dll   1.5.3.2578    0            4          11       0  
Apache.NMS.dll            1.5.0.2194    0            0           4       0  
log4net.dll               1.2.11.0      0            0           6       3  
MyServiceUtils.dll        1.0.0.0       1            0           0       0  
MyService.exe             1.0.0.0       0            0           1       0  

也许不可能运行这项服务? log4net有几个p / invokes等。

1 个答案:

答案 0 :(得分:0)

如果你使用sudo apt-get install mono-complete安装了mono, 你可能想看一下mscorlib。

Mono take mscorlib.dll 2.0 instead of 4.0

Unable to run .net app with Mono - mscorlib.dll not found (version mismatch?)

可能有用。