1

我在 windows 上使用 monodevelop 构建了解决方案,然后使用 Filezilla 将文件传输到我的 vps。它在 Windows 上运行良好。但是当我尝试使用 mono steambot.exe 运行 steambot 时,我得到了错误:

Unhandled Exception: System.MissingMethodException: Method not found: 'System.Array.Empty'.
  at SteamBot.Program.BotManagerMode () [0x00000] in <filename unknown>:0
  at SteamBot.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'System.Array.Empty'.
  at SteamBot.Program.BotManagerMode () [0x00000] in <filename unknown>:0
  at SteamBot.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
mattimat@mattimat-ubuntu:~/steambot/SteamBot-master/Bin/Release$ mono SteamBot.exe
Missing method System.Array::Empty<[1]>() in assembly /usr/lib/mono/4.0/mscorlib.dll, referenced in assembly /home/mattimat/steambot/SteamBot-master/Bin/Release/SteamBot.exe

Unhandled Exception: System.MissingMethodException: Method not found: 'System.Array.Empty'.
  at SteamBot.Program.BotManagerMode () [0x00000] in <filename unknown>:0
  at SteamBot.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'System.Array.Empty'.
  at SteamBot.Program.BotManagerMode () [0x00000] in <filename unknown>:0
  at SteamBot.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
mattimat@mattimat-ubuntu:~/steambot/SteamBot-master/Bin/Release$

单声道版本:

Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-8+deb7u1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

同样,在 Windows 上工作正常。VPS 是 Debian 7.11 x32

4

1 回答 1

1

public static T[] System.Array.Empty<T>()已在.Net 4.6中添加,因此您的旧版本 Mono 将运行 .Net 4.5,并且会出现错误。

要么将您的 Mono 版本更新到 4.8+,要么删除Array.Empty对 .Net 4.5 框架的使用和编译。

回复:https ://msdn.microsoft.com/en-us/library/dn906179(v=vs.110).aspx

于 2017-02-25T18:01:13.427 回答