我在使用windows10下的Monogame内容管道时遇到了一些问题,注意这是我第一次使用Monogame。
model = Content.Load<Model>("cube");一切都构建成功了,看起来是在正确的位置,但是.xnb本身有问题。
我已经追踪到了这个位置的异常
if (x != 'X' || n != 'N' || b != 'B' ||
!(targetPlatformIdentifiers.Contains((char)platform)))
{
throw new ContentLoadException("Asset does not appear to be a valid XNB file. Did you process your content for Windows?");
}问题是platform的值为103,这是一个g
static List<char> targetPlatformIdentifiers = new List<char>()
{
'w', // Windows (DirectX)
'x', // Xbox360
'm', // WindowsPhone
'i', // iOS
'a', // Android
'd', // DesktopGL
'X', // MacOSX
'W', // WindowsStoreApp
'n', // NativeClient
'u', // Ouya
'p', // PlayStationMobile
'M', // WindowsPhone8
'r', // RaspberryPi
'P', // PlayStation4
// Old WindowsGL and Linux platform chars
'w',
'l',
};我已经从Github下载了Monogame,并将WindowsGL版本添加到我的项目中。
我尝试过将Windows、WindowsGL和Linux作为内容管道中的一个平台,它总是导致平台成为103。
发布于 2015-08-06 00:49:36
我犯了一个错误,我克隆了Monogame的最新版本,但我应该使用checkout切换到v3.4版本。
https://stackoverflow.com/questions/31835748
复制相似问题