Monogame在Windows Phone上运行速度非常慢

时间:2015-05-14 17:00:17

标签: c# windows-phone-8.1 windows-8.1 monogame

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

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

在查看输出窗口后,我看到mscorlib.dll每秒大约抛出五个System.IO.FileNotFoundExceptions!我知道这是错的,但我找不到有关正在发生的事情的任何其他信息。它必须是Monogame,因为我在端口期间几乎没有更改任何代码。

有什么想法吗?

输出(构建后)

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).

1 个答案:

答案 0 :(得分:1)

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

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