我刚刚转到mac,我正在使用monogame继续使用XNA进行开发。
但是,当我尝试使用Gamepad.GetState(index)
时,它会抛出以下错误。
System.IO.FileNotFoundException:无法加载文件或程序集' Tao.Sdl,Version = 1.2.13.0,Culture = neutral,PublicKeyToken = 9c7a200e36c0094e'或其中一个依赖项。 在Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex) 在MuliversrseRPG.InputHandler..ctor(Microsoft.Xna.Framework.Game)[0x00063] /Users/aaron.wheeler/Projects/MultiverseRPG/MultiverseRPG/xna/InputHandler.cs:94 at MuliversrseRPG.Game1..ctor()[0x00068] in /Users/aaron.wheeler/Projects/MultiverseRPG/MultiverseRPG/Game1.cs:62 at MuliversrseRPG.AppDelegate.FinishedLaunching(MonoMac.Foundation.NSObject)[0x00002] in /Users/aaron.wheeler/Projects/MultiverseRPG/MultiverseRPG/Main.cs:35 at at(wrapper dynamic-method)object。[MultiverseRPG.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)](MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) at at(wrapper native-to-managed)对象。[MultiverseRPG.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)](MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) at at(wrapper managed-to-native)MonoMac.AppKit.NSApplication.NSApplicationMain(int,string [])< 0x00012> 在MonoMac.AppKit.NSApplication.Main(string []) at MuliversrseRPG.Program.Main(string [])[0x0001d] in /Users/aaron.wheeler/Projects/MultiverseRPG/MultiverseRPG/Main.cs:22
答案 0 :(得分:1)
我通过将Tao.sdl.dll文件添加到项目并为项目添加.net引用来解决这个问题。
感谢您的帮助