Monogame 运行 在 Windows Phone 上非常慢

Monogame running very slow on Windows Phone

最近,我决定复活我的一个旧 XNA 游戏项目,并使用 Monogame 将其移植到 Windows 通用应用程序。我设法在 Windows 8.1 上完美地 运行 玩游戏(尽管性能稍差),但是 运行 在 Windows Phone 上遇到了一些大问题。

首先,它正在渲染肖像,但我使用 RenderTarget2D 修复了它,如其他地方所述。但最重要的问题是游戏 运行 的 <8 fps。我认为这可能是内存问题,所以我 运行 分析器但没有发现任何异常(游戏总是使用大约 150MB)。

查看输出 window 后,我发现 mscorlib.dll 每秒抛出大约五个 System.IO.FileNotFoundExceptions!我知道这是错误的,但我找不到任何关于正在发生的事情的额外信息。这一定是 Monogame 的问题,因为我在移植期间几乎没有更改任何代码。

有什么想法吗?

输出(post-构建)

Other load calls here...

'Operation Furball.WindowsPhone.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.LINQ.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Operation Furball.WindowsPhone.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.CORE.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Operation Furball.WindowsPhone.exe' (CoreCLR: .): Loaded 'C:\Data\SharedData\PhoneTools\AppxLayouts\be3bbc51-434b-4ead-9cac-b80c7890a503VS.Debug_AnyCPU.Ramsay\SharpDX.MediaFoundation.DLL'. Cannot find or open the PDB file.
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll

...many more errors here...

A first chance exception of type '<unknown>' occurred in Unknown Module.
The program '[2896] Operation Furball.WindowsPhone.exe' has exited with code -1 (0xffffffff).

感谢 thumbmunkeys,问题已解决。调试器使游戏非常慢,因此不附加调试器会使游戏恢复到 30fps。

这可以通过使用 Visual Studio 部署应用程序进行测试,然后停止调试器并在设备上启动游戏。