尝试在vps debian上运行steambot时出错System.MissingMethodException:找不到方法:' System.Array.Empty'

时间:2017-02-25 17:14:46

标签: mono monodevelop steam steambot

我在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

1 个答案:

答案 0 :(得分:1)

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

将您的Mono版本更新为4.8+或删除Array.Empty的使用并针对.Net 4.5框架进行编译。

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