エラーメッセージ全体はここにあります:
There was an error while deserializing intermediate XML. Cannot find type
"WindowsGame1.Tile".
XNAゲームを作成していますが、現在、xmlファイルからタイルベースのレベルでロードしようとしています。現在、私のxmlファイルは次のようになっています。
<?xml version="1.0" encoding="utf-8"?>
<XnaContent>
  <Asset Type="WindowsGame1.Tile">
    <Tile>
      <X>0</X>
      <Y>0</Y>
      <ImageName>grass-tile</ImageName>
    </Tile>
  </Asset>
</XnaContent>
そして私のC#ファイルは次のようになります:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace WindowsGame1
{
    public class Tile
    {
        public int x;
        public int y;
        public string imageName;
        public int X
        {
            get { return x; }
            set { x = value; }
        }
        public int Y
        {
            get { return y; }
            set { y = value; }
        }
        public string ImageName
        {
            get { return imageName; }
            set { imageName = value; }
        }
    }
}
XPathライブラリを使用してxmlファイルを解析し、Tileを作成するクラスがありますが、xmlのものが機能しないため、現在すべてコメント化されています。Game1クラスで、以下をインポートしてみました。
using WindowsGame1.Tile;
および参照:
Tile tile;
このタイルクラスは、これに対する解決策を見つけようとしたときに見つけた提案によると、それでも同じエラーが発生し、ゲームがビルドされません。このXMLを機能させるために何を変更する必要があるか知っている人はいますか?
XMLを解析する必要のあるコードは次のようになりますが、現時点では、コンパイルできるようになるまですべてコメント化されています。
namespace WindowsGame1
{
    class ActionScreen : GameScreen
    {
        public ActionScreen(Game game, SpriteBatch spriteBatch, String file,  AnimatedSprite sprite)
            : base(game, spriteBatch)
        {
            this.file = file;
            this.sprite = sprite;
            initializeTiles();
        }
        private void initializeTiles()
        {
            XPathDocument doc = new XPathDocument(file);
            XPathNavigator nav = doc.CreateNavigator();
            XPathNodeIterator iter = nav.Select("tile");
            while (iter.MoveNext())
            {
                int x, y;
                string fileName;
                x = int.Parse(iter.Current.GetAttribute("X", ""));
                y = int.Parse(iter.Current.GetAttribute("Y", ""));
                fileName = iter.Current.GetAttribute("ImageName", "");
                Console.WriteLine(x + " " + y + " " + fileName);
            }
        }
    }
}