一夫一妻制 "Could not find ContentTypeReader Type"

Monogame "Could not find ContentTypeReader Type"

如何解决这个问题:

Microsoft.Xna.Framework.Content.ContentLoadException: "Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ReflectiveReader1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent, MonoGame.Framework.Content.Pipeline, Version=3.8.0.1641, Culture=neutral, PublicKeyToken=null]] (Microsoft.Xna.Framework.Content.ReflectiveReader1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent, MonoGame.Framework.Content.Pipeline]])" ?

Monogame.dll中没有MaterialContent,这是Pipeline的内部基础class。编写器无法将其转换为 BasicMaterialContent,因为导入器未生成正确的对象。该错误有点误导,因为 ReflectiveReader 用于序列化没有 reader 的项目。它应该说 MaterialContent 不存在。 我已经在我的分支中修复了它。您可以执行以下操作:

  1. 下载ProtonType.Aether.v1.0.0.zip, 来自 https://github.com/tainicom/ProtonType.Aether/releases/tag/v1.0.0 它是 Monogame 的独立构建系统。 解压缩,运行 Protobuild.exe,打开 .mgcb 并构建资产。

  2. 下载并运行自定义构建 Monogame SDK 来自 https://github.com/nkast/XNAGameStudio/tree/master/MG%20SDK 这作为 v3.8 之前的 MonoGame 使用的 SDK。 运行 Pipeline.exe 来自 C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools 打开 .mgcb 并构建您的内容。

    确保新的 xnb 不是 rebuild/overwritten,最安全的方法是将 .xnb(s)(模型和纹理)复制到您的 Content 文件夹,删除库存处理器并添加带有 action=Copy 的 .xnb。 或者,如果您安装了 SDK,请从项目中删除 3.8 Build.Task nuget 并添加使用已安装工具构建内容的旧目标。