Q: Loading data from XML file into XNA 4.0 This is a problem that I've been working on for a few days now. I managed to make a Game library that has 2 classes - one contains the name's and type's of variables I want to change, and the other is used to write into a XML file (serialization). 
This is my serialization class:
namespace Postavke
{
    public class TempMain
    {
        public static void Main()
        {
            object TestValue = new PostavkeStanice();
            XmlWriterSettings XMLPostavke = new XmlWriterSettings();
            XMLPostavke.Indent = true;

            using (XmlWriter pisac = XmlWriter.Create("Postavke.xml", XMLPostavke))
            {
                IntermediateSerializer.Serialize(pisac, TestValue, null);
            }
        }
    }
}

The class that I want to serialize ("PostavkeStanica") has only one bool variable, so the XML file is very, very simple.
The problem appears when I want to load the data from XML into my XNA 4.0 program. I use the ContentManager, but when I try to use the variables that should have their values set by this, I get the error 
"There was an error while deserializing intermediate XML. Cannot find type Postavke.PostavkeStanice"."

In declaration region:
ContentManager upraviteljSadrzaja;
PostavkeStanice radnaStanica1;

In the LoadContent method:
radnaStanica1 = upraviteljSadrzaja.Load<PostavkeStanice>(@"Teksture/Postavke");

The "PostavkeStanica" class has only one bool variable called "Stanje" which I want to use to determine if a certain object is enabled or disabled, for instance:
if (position == stanica1 && radnaStanica1.Stanje)
            {

                kontrola = false;
            }

This piece of code determines if a movable object is in front of radnaStancia1 object (which doesn't change its position) and when the contition is true it stops the movement.
I'm trying to use the XML file to set the value of this variable because I want to be able to change the value of that variable without rebuilding the whole solution.
Please advise, thank you.

A: Sometimes when the deserializer can't find the type, it is either because the game library isn't referenced - or -  during build time when the compiler is trying to make sense of that content.load statement, the game library that holds the type it is trying to find hasn't been built yet.
Make sure to set the dependency of the main game project to depend on the library AND reference it too. When the game library is set as a dependency, the compiler knows to build it first.
