尝试在 vps debian 系统上运行 steambot 时出错。缺少方法异常: 找不到方法: 'System.Array.Empty'



我已经在Windows上使用Monodeveloping构建了解决方案,然后使用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

public static T[] System.Array.Empty<T>() .net 4.6 中添加

要么将您的单声道版本更新为4.8 ,要么删除了Array.Empty的使用情况,并根据.NET 4.5框架进行编译。

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

最新更新