I have a factory method in a normally instantiable class. Intellisense shows that it is valid (i.e. it shows up when I type “Entity.”) and shows the proper tooltip before building. When I build, however, I get this error:
‘EvergreenEngine.Entity’ does not contain a definition for ‘Load’
What is going on here?
This is my class. Ignore that the method doesn’t actually do anything for now.
// Represents an object in the game world
public class Entity
{
// Snip other methods and stuff
// Loads an entity from an XML file
public static Entity Load(string filename) // Apparently undefined
{
Entity newEntity = new Entity();
XmlTextReader reader = new XmlTextReader(filename);
while(reader.Read())
{
Logger.Log(reader.Name);
}
return newEntity;
}
}
SOLVED IT
Apparently, I had it compiling to x86 (I’m on a 64bit machine) and VS didn’t like that. Very odd.
Apparently, I had it compiling to x86 (I’m on a 64bit machine) and VS didn’t like that. Very odd.
It worked when I set it back to Mixed Platforms.